The Department of Energy recommends homeowners replace their HVAC system every 10 to 15 years. So check the age of it first. If it's not that old, I recommend it to just repair.
Repair or replacement of HVAC system depends on factors like age, frequency of repairs, energy efficiency, and overall condition. Consult a professional for advice.