I don't know if this will work, but I once saw a control system on dispensing equipment that used a couple of relays in succession to keep the operator from turning off a dispenser and then back on to steal gasoline. The problem was that when the electric reset completed its cycle, it operated a switch that dropped power on one leg and sent it on another (like a 3-way). The momentary lapse of power during the switch changing caused the control relays to drop out prematurely (the 1st one sent power to the second.... something like that, it was 25 years ago). The solution was to install a capacitor in parallel with the coil of the relay. That capacitor held the coil in long enough for the switching to be made.
It sounds like a momentary lightning strike is causing a flicker in the supply that is dropping out your controls. If that is what's happening, the cap trick may work. If you completely loss power, the controller would not remain on.