[rant]I honestly think it's bull**** that people don't think the 50D is a major improvement over the 40D. I shot photos with the 40D nearly every day for the past year and the 50D just seems to do everything better. Everyone on this forum just wants to whine about features and it seems none of them care to credit a highly advanced cameras shortcomings as their own inability to take a photo. [/rant] haha
You're thinking in a great way. Buying a L-series lens can be one of the best decisions you can make. They are truly incredible lenses and do everything well from build quality, autofocus, IQ, and feel.
The 40D's major problem IMO has been its screen. I can't tell you how many times I looked at my screen (another luxury we get with digital over film) and believe a shot came out when it didn't or visa versa. It's a smooth performer and you'll be very happy with it.
The 50D, to me, corrects my gripes I had with the 40D. Having owned it now for over a month I can tell you that the autofocus is actually much better. The AF-ON button (it's what I use at road racing events) is honestly an "ON" button. Mated with my 70-200 2.8 IS it is nearly instant to focus on the subject without any confusion. The 40D performs very well but the 50D seems to have a leg up in some areas. For someone like me, these are enough to qualify it as a major improvement.
The 5D mkII is another camera where all the whiners on this forum just have to find something to complain about. The 5D mkI will always be an outstanding camera and everyone was looking for something that would just blow their mind. Therefore, rumors about this fairytale camera body started surfacing on this forum. When it came out and it was a realistic interpretation that is essentially a 5D mkI with marginally better performance but greatly increased pixels and a feature-filled layout, it wasn't enough. People still want the fairytale camera. Well it's not coming.
The fact in this situation is that the 40D is a great camera body and so is the 30D if you haven't considered (~$800 now). You will be very happy with the 40D and I highly suggest you buy it. If you're debating the prices of the higher priced cameras, don't buy them. You can save now and buy good glass and then you'll be in a better position later on when you go to buy a 60D or whatever you plan to buy next.
So take from my post what you will. I will say that if you go to a store and hold a 40D and a 50D next to each other, you will probably talk yourself into buying the 50D. Especially when you see the difference in color and quality of the screen. (The 50D is the same resolution as a Polaroid photo. Imagine that on the back of a camera!)