Agree with kalel33, upgrading lens will improve your image quality more than upgrading the camera body.
There is not a huge difference in performance between the entry level D-SLR vs 40D, except for the faster speed (fps) and better AF, only important if you routinely shoot fast actions.
But there is quite a big difference between the regular EF-S 18-55mm kit lens vs the EF-S 17-55mm f/2.8 IS. The 17-55mm f/2.8 IS lens not only has better image quality but can also do handheld low light shots that are very difficult or impossible for the 18-55mm lens.
From the list of your gears, you probably seldom do low light actions, but may do a lot of flash photography. If you don't need a large aperture lens and you are on budget, then you can consider the following lenses:
EF 17-40mm f/4L
EF 70-200mm f/4L
Or Sigma has some moderately priced f/2.8 zoom lenses
The Canon EF 24-105mm f/4L IS is very good and moderately priced, but it is neither wide nor long enough as a single lens for the APS-C size sensor. It is more suited for a full frame body.
If I were you, I will not buy another 18-55mm IS lens even though it is slightly better than your old one, and I will not buy another 70-300mm lens. Getting the wide aperture lenses will improve your image quality and open up more photography possibilities. If you do indoor or low light action photos or need a better bokeh effect for portraits, then you may like f/2.8 or wider apertures, but these usually cost more. If you don't need very wide apertures, then the f/4 lenses can be a pretty good bargain comparatively.
There is not a lot of difference between 40D and 50D, except the center AF point of the 50D is more sensitive for f/2.8 lenses, which won't matter to you much at this point. But if you have a fast zoom tele with f/2.8, and you do a lot of lower light action photos, the 50D is a better choice. The bigger LCD is not that important, and won't improve your image quality. Anyways, you still won't be sure about the sharpness of your shot until you look at it on the computer screen.