I'm in the cheaper body-better glass camp. Go for the K10D. You'll get almost all the features of K20 for about half the price.
Just in case you haven't checked this thread out yet...
https://www.pentaxforums.com/forums/pentax-dslr-discussion/35134-k10d-vs-k20d-vs.html
...it'll give you some more insight into the issue.
Quality glass doesn't have to be super expensive, but you don't want to skimp on it either.
Something else to think about is that since you're just getting started with photography, there will be other things you'll want or need besides a body and lenses--things like a camera bag, lens filters, extra batteries, a decent tripod or monopod, editing software, etc. You don't want to sink everything into your body, considering that you're on a limited budget and need a lot of other things besides a body and lenses, as well.
HTH,
Heather