I switched from a K20D and some cheap lenses (some of them were excellent, though) to a 40D with the EF 85mm f1.8. That 85mm is a great piece of glass, and my entire reason for switching, but that's an aside from your question.
Regarding the K20D vs. the 40D: The 40D is bigger/heavier, made of metal but less sealed, has a smaller viewfinder, and is a heck of a lot faster. AF speed isn't terribly important to me but that 6.5 fps was a lot of fun and occasionally even really beneficial.
On the other hand, I preferred the ergonomics and control layout of the K20D, SR is often genuinely helpful, and aside from the higher resolution, I find the colors from the K20D more "realistic" looking no matter what I do in post, found the DR at low ISO to be about equal, and actually found the K20D's high-ISO performance more satisfying than the 40D's. A little less overall image noise, and the noise present was of a more subjectively "pleasing" variety, interfering with the image less than the 40D's more digital-looking noise. I didn't like using the 40D above ISO 400 (200 if I could help it) but I cranked the K20D up to 1250 from time to time without regrets. I've never understood why so many considered the 40D to be such a low-light performer.
After my time with the 40D, I've moved back to Pentax with the K-x, and found that it gives me better image quality than even the K20D while still being almost as speedy as the 40D (aside from write times), and I find that I don't miss either of the previous cameras. Occasionally it feels like a semipro featureset would be nice to have, but the portability of a consumer-grade body is an acceptable tradeoff for me.
That EF 85mm on the other hand, is something I can miss.