If you live in the US, Apple has a flat rate option for out of warranty repairs. It starts at *I think* $255, depending on the model, but they'd repair anything that needs to be repaired and puts the computer into a warrantable state for 90 days.
I think the decision to replace it depends on what you use it for. I'm personally not a fan of buying used from someone I don't know because I wouldn't know how it was cared for or if it has any existing issues, but I'd consider buying refurbished from Apple (comes with a 3 year warranty).