The sb-400 is a nice small flash. It doesn't weigh your camera down and its easy to leave on all the time. I have one. But it doesn't offer huge amounts above the built in flash. It is a bit more powerful and you can bounce it off the ceiling. It will improve your indoor family type pictures. It will also save running down your camera's battery if you have many shots to take. Its worth having a sb-400, but think about why you want it. Maybe money better spent for something more powerful. I also have a SB-700. It is a good amount more powerful and has other neat features. I end up using it more outdoors in the daytime for fill flash. I like them both, but if I had to give up one, it would be the sb-400. There are non-nikon flashes that I am not familiar with, you might want to post or search in the flash forum. No right or wrong decision on a sb-400, just be sure it will do what you want.
I love the d7000, but think about that too. Is that the user interface that you want? The d7000 has more direct access to many functions for quick changes as you shoot. Also the top display is great to quickly know what your main settings are. Some people rather not think about that and others demand that capability. You may be more comfortable with a d5200 if you really loved your d5000. Download the manuals and check them out in person if possible. D7000 is great, but wont necessarily take better pictures.