I always say buy the most flash you can afford since you can never have enough flash power.
If you can afford it buy an SB-900, you will have the full Nikon CLS including full wireless ability along with accessories. You will also have a commander device for your D40 or a 3 group remote commander for your D40 and D300, if you buy another SB-900/600. Although you can use your D300 as a flash commander.
If you can not afford an SB-900, then go for the SB-600. You will not have the accessories, but your D300 can command the SB-600 off camera.
You could even get the SB-400, but it is not much more powerful than your pop-up flash, has limited bounce ability, and has to be wired to your camera for use.