Which lens are you actually planning to get? If you're getting the 50mm, make sure you get the AF-S and not the AF-D lens, as only the former will autofocus on your D40. What exactly is it that you're shooting at night? If it's something moving, then the VR lens won't help you much, but the f/1.4 lens definitely will (although I'm surprised no one has suggested a good flash); however, if it's stationary, and you're doing long exposures, fast glass is pointless (unless you really need shallow DOF), and you'd be better off investing in a good tripod (i.e. Bogen/Manfrotto, etc).
The D90 is a better camera because it offers improved autofocusing and slightly better manual control along with its higher-resolution sensor, but it's not a substitute for a good lens, and certainly not a substitute for a good photographer.
That said, I love my D300.
Also,
Yes, absolutely. Silenced. People really are not to blame for bad photos, unless they're blamed for not buying a D90. Because I know that blurry, poorly composed, overexposed photos are automatically made amazing when they're shot using the magic of a CMOS SENSOR. In fact, a chimp throwing a D90 at a brick wall will somehow end up taking a better photo than a decent photographer with the so-inferior-it-might-as-well-be-a-tree-branch D40. Thanks, numbersyx, for clearing this up for all of us.