I can't think of a better way of handling this than how you did it. I think you were correct in that putting Lily inside would probably resolve the problem. Personally even without the barking, I don't think I would be comfortable leaving a young puppy outside while I was gone from the property.

Maybe you could give your neighbors a good dog training book that would address this issue (as well as others). They definitely need a little education when it comes to raising a puppy. A book I often give as a gift to new dog owners is *Good Owners, Great Dogs* by Brian Killcommons and Sarah Wilson. I don't have a copy in my house right now as I keep giving any I have away as a gift, so I can't say for sure that they address this issue but I think it would.