If your problem involves the things that hang on the outside of the engine, such as the alternator, pumps and belts, it probably pays to replace them as they fail. And a cheap paint job and seat covers can make the cosmetic and comfort problems tolerable. If the problems are deep down in the engine and transmission, then it might be time to concede the end is near. Certainly, it doesn't make sense for monthly repair bills to average more than the payments on a replacement vehicle. If you decide you need another car, it's most economical to get a good used one, probably one that's two or three years old.
All vehicles depreciate, or lose value, fastest during the first three years.
But don't buy a used vehicle until you've checked out the new ones. I was startled to discover two years ago that a used pickup with 40,000 miles on it was so expensive that it only cost a few thousand dollars more to get a new one with a three-year warranty. Leases are popular because the monthly payments can be much lower than monthly loan payments for the same vehicle. Leasing makes sense only if you insist on having a new vehicle every two or three years. Assuming you have enough cash to buy, the answer depends on your alternative uses for the money.