Most garage door openers can be repaired without much of a problem. And this is often a less expensive option than replacing the unit. Usually, we recommend repair over replacement for this reason.
There are other times, however, when replacement is the best option. For instance, if the unit is more than 15 years old, repairing it would be a waste of your money, here's why:
Federal Regulations (UL 325) were updated in 1993, which made garage door openers safer. If yours was manufactured before that date, it is unlikely your house would even pass an inspection with it.