One factor on a used car is warranty. If you pick up a two year old car, which seems like the best value, you get some factory warranty and the option to buy an extended warranty. Then, your potential repair cost exposure is limited. But, let's assume costs only with the factory warranty to keep it simple. Extended warranty costs would be equal for each scenario, but still, the used car would net two years less coverage.
In my case, it made more sense to get the CX-7 and have a lease payment for 27 months than keep my current vehicle (1998 Expedition) which I owned outright for years and put away money to purchase a car cash in two years. If you factor in $1400 per year for repairs (it was out of warranty) and the cost of gas, the CX-7 is basically "free" for the 27 months ($194 per month). So, $5000 in payments, a $4000 cap cost reduction, and a $19,000 residual for a "purchase" cost of $28,000. You also will have to add $1400 in tax for the residual purchase, the $300 for license fees for a real total of $29,700. I will buy the car at the end for the residual cost. If it is not worth that much, I will turn it in, then buy it for whatever it is worth even further reducing the vehicle cost.
If I bought the car, it would have been $26,000, plus tax ($1700) plus license ($300) for a $28,300 cost. Finance that over 60 months with same $4000 down, even at 7% over 5 years, and you are looking at about $476 per month for a total out out of pocket cost of $28000 in payments plus the down of $4000 for a total cost of $32,000. So, $2300 more than the lease.
How about a used one two years old for $21,000? Add tax of $1400 along with title fees, etc, and the down payment of $4000 to finance that over 60 months (along with the requisite 2 to 3 percent hike over new, since it is used) and we have a $ 390 payment over 5 years for a total cost of $23,400 plus the original $4000 for a total cost of $27,400. So, a savings of $2300 over the lease for two years less warranty and assuming you have NO out of warranty repairs during that time.
I did my homework, and these are the numbers I considered for my decision. Everyone's values are different, but for the marginal cost of new over used, I chose new.