Good question. The first part will not be math based and will be more of a personal preference, but I will try to back it up with facts when possible.
My take:
I would buy the slightly more expensive car with less miles. The reason is because that is exactly what I have done in the past. A car with only 70,000 some miles left has significant amount of drive time on it. It also means less wear in a given time period. The fact that someone drove 170,000 miles on about 10 years means they drove 17,000 miles per year.
The average american only drives about 12,000 miles per year. So that means they drove 50% more than the average american driver. That is a lot of wear and tear on a car in a short period of time. When you are driving it that much, I feel like keeping up on the maintenance can be difficult compared to the more expensive less miles car.
I bought a car with 74,000 miles on it for $5800 and I have not had any problems since I purchased it five years ago. The only thing I have had to do is minor stuff like lights, brakes, and tires. Other than that I have not had any problems. *Knock on wood*
I cannot come up with a mathematical formula, but this guys insights might be extremely helpful to you:
http://www-math.bgsu.edu/~zirbel/carcosts/