I also own a D40, and I'd love to have more buttons and switches for quickly getting to those settings like metering mode etc. You know, those things you can do just a bit easier on a more expensive model.
But really, technically, I don't think body upgrades will improve my pictures much. Perhaps a couple megapixels, but I don't think one should worry about that too much. ISO performance only improves when you go to a D300, and that's just a bit too much.
No, if you want more flexibility, I think money is better put towards more glass. Ofcourse, a D80, would allow you to use older and cheaper glass. But if that body upgrade means you won't be able to buy lenses for a while, what's the use? Hell, even then, manual focus could be seriously inspiring.
Flash wise, the only thing the D80 has over the D40 is the ability to use the built-in flash as a commander for an off-body flash. That's cool, but still a compromise. You still really want a SB800 as your commander. And there a lot more ghetto solutions for people on a budget, that work with a D40. Student+Ghetto=Good let me tell you
If you want better pictures, money is better put towards theory, experience and inspiration.
Read this and rethink your camera upgraditis:
Alex Majoli points and shoots 
Anyway, that's just my two cents.