In general, you should calculate automotive cost of ownership by adding up six numbers; annualized over how long you anticipate owning the car, or 5 years, whichever is shorter. For a 5 year calculation the numbers are:
Depreciation - check the purchase price of the car (plus fees, taxes, etc) minus the kbb value of the same car 5 years older and with 5 more years of your miles per year, and annualize.
Insurance - Note that if you're driving around an expensive vehicle that you want collision on, that may drive your premiums up a lot.
Opportunity cost (or financing cost) - Take the average value of the car over the five years (average the purchase price with the 5 year old value) and multiply that by what you average on your investments. Alternately, if you were financing, you would multiply this by your interest rate.
Mortality cost - For the sake of argument, lets say your life (and the life of each of your passengers) is worth $8,000,000. Or to put it another way, you'd hypothetically be willing to pay $80,000 to reduce your likelihood of dying in the next year by 1% (say from 2% to 1%). Go to the IIHS driver death rates page and figure out the driver mortality rates for your prospective vehicle (given in driver fatalities per million vehicle years). Assume passenger mortality is the same as driver mortality. Multiply your average number of passengers * the table mortality rate * your personal value (8 million) divided by 1 million vehicle years. For example if you average 1.2 passengers in an 07-08 Honda Fit, the mortality cost ends up being 1.2*63*8million/1million = $605. If you went for a safer vehicle, you could reduce that mortality cost. Note that numbers for different vehicles aren't exactly apples to apples; i.e. I suspect the people who purchase Kia rios just aren't as safe drivers as those who buy Acura TSX's, and some vehicles have zeros, meaning no drivers happened to die in them; indicating there is some statistical noise here. But if you feel like you're an average driver of whatever vehicle you're considering, these are the best numbers we're going to get for comparing the apples and oranges of safety and cost.
Repair and maintenance - How much will the scheduled maintenance cost you, plus tires, unexpected repairs, etc. Truedelta and edmunds have some data that can be helpful in predicting this.
Gas - What do you think the average price of gas will be over the next five years * your miles per year/mpg.
If you figure all this stuff out for each car you're thinking about getting (do a spreadsheet) you can figure out what car is most efficient for you. In general, the cars $9k+ cars you are looking at are probably too expensive to be optimal, but obviously they're not horrible. $5k priuses do really well, actually - a lot of the post '04's even have ESC. Depreciation is low; gas is low, ESC keeps you safe, they're cheap to fix.
Here's why you should buy from a private party selling his or her own car: For $100 (or so) you can take a private sale car to a dealer and they will go over your potential car with a fine toothed comb. They will basically look for all the stuff they would if they were selling the car. Sure they might miss something; but they might miss something with a car they're selling too. They want to catch everything, because you might give them the repair work for what they find. Compare that $100 to the KBB difference between private party and dealer car values ($2k for the cars you're looking at?). Note that I say from a private party selling his or her own car. There is a whole class of car flippers out there who are expert at getting damaged cars running in the absolute cheapest way possible and hiding flaws. I've looked at a couple of cars from folks like that with all manner of engine shakes, "washed" salvaged titles, small head gasket leaks, you name it. A mechanic or carfax caught them all, but after so many bad apples, I don't trust the bunch. Small third party dealers can have some of these problems too, but at least with a dealers license you have some legal protections that you don't buying from a private party.