High going pulse

Code doesn't stop working mysteriously, it doesn't break like a mechanical device. So if it did work before but not now, something changed. Either you edited and uploaded new, different code, or the characteristics of the inputs have changed and no longer match what the code's looking for.

If that line is supposed to act like an if, why is it not an if? Maybe that's the accidental edit you made?

(But the code you posted there is incomplete anyway, it has no setup(). And you initialise state as LOW then (at least in the code presented) never change it again.)

Is this the actual code in your Arduino right now?