Leaving just now for another exciting episode of Real Life, but I can say…
if you read through my code and try it in the wokwi, then carefully examine the ways in which my frame sequencer differs from yours, you may be able to succeed.
In the meantime or if you fail/give up, post the current version and L8R I will try to hook it up in the wokwi and visit the same adjustments to one of your functions.
The main idea is that each function can and should be called every loop, usually doing nothing.
And we let the function finish even if the logic signal that started it going disappears.
This
if (!turnMachineStep(1) and !digitalRead(3)) {
turnMachineStep(0);
}
might be a little clearer if less compact rendered like
unsigned char running;
running = turnMachineStep(1); // step the sequence
if (!running and !digitalRead(3)) // start/restart the sequence
turnMachineStep(0);
a7