The only part that was changed is below.
if (PINB & 1) // Make sure that cancel pin is HIGH (not active):
StopTime = 3;
while ( seconds() < StopTime)
StopTime = calculateStopTime();
Triggered = 1;
CoilOn = 1;
I was advised by someone on this forum 6 years ago in how to change this.