I'm surprised there are any New 40d's around anymore, the 50d is due a replacement in the near future, so the 40d is well over 18months discontinued.
Personally i would look at low mileage used bodies. Camera bodies depreciate like new cars, if you buy used then you make a large saving, but risk having to bare the brunt if a camera fails. Alternatively somewhere like MPB photographic offer a 6 month warranty on their used products which are very well priced, so thats a little piece of mind.
If you can afford the 50d then it is worth it.