Arduino as Generator Auto Start System

You say it worked fine for a while - how long was that? Several weeks?

If the code you have posted is identical to the code that worked fine I doubt if the problem is there. More likely some component has been stressed or something has come loose.

Another possibility is electrical interference between the generator output or the high voltage ignition system and the Arduino. Though why that should be a problem now if it was not a problem previously? Maybe some wires have shifted their position due to vibration or heat.

You don't seem to have any diagnostic Serial.print() statements in your program so you can see what the Arduino thinks is happening

...R