Creating a state machine to make ice

It's virtually always faster and easier to troubleshoot the original circuit and repair it. In older equipment like this, it often turns out to be something fairly simple like a leaky capacitor.