I would keep the 40D for now and look into some better and faster lenses. While the 7D is a fantastic camera and a step up from what you have now, it's still getting a bit old. And if you are happy with the 40D I don't see much point in upgrading.
I would suggest you do not downgrade to a TXi / xx0D. You might get a better sensor, but you lose so much in terms of build quality and usability imho (smaller darker viewfinder, smaller plasticy body, also no weather sealing, no second command dial, no top lcd, worse AF-system... etc etc)
Hope it helps!
Also newer generations of photoshop might give you an advantage when processing noisy pictures. Not sure what you are using. When I went from Lightroom 1 to lightroom 3 there was a HUGE difference in quality when processing noise. I'm waiting to buy LR5 when it comes out, hopefully I'll be as impressed as I was back then