We had something similar happen before. We weren't looking for a car, but a friend was going to get rid of car because "it would cost too much to repair it." My husband's main hobby is fixing cars, so he bought for 1000$ and fixed it for under 500$. At that point it was a better car than one of ours, so we sold our car for 2500$ (which was purchased 3 year prior for 3000$). When we moved we ended up selling our friend's former car for 2800$. I'm not sure of the exact maintenance figures for both vehicles...I think we came out ahead by about 1500-2000$.
Of course we couldn't really tell the friend about all this. No one likes it when someone else make money off their dumb mistake. And yes, my husband did explain that it wouldn't cost too much to repair and he shouldn't get a new car.