There's a piece of wisdom about cars and appliances that unless there's some egregious defect that turns it into infinite money sink, the least costly (and in fact the most environmentally friendly) option is to run the one you currently have until it disintegrates. Because the price of a new one is usually like your electrical bill for the current one over multiple years, adjusted for inflation and price hikes.
There are of course exceptions, but rules of thumb are never 100%.
The thermostat is dying, so I picked up one of those thermostat plugs with a probe on a wire. Gonna keep it as long as I can. (Plus it's the perfect size for its space, and they don't make that size any more.)
(Owner of a ~90-year-old Frigidaire here.)
Plus (X / 1.5) * (1 - S), where S is probability of successful repair.
Plus the repair cost of the next thing to go if many parts are reaching the end of the design life (= warranty * 1.1)