Without doing a major overhaul of your code, this might work...
const int PinRestartButton = 2; //put the 'restart' button on this pin, connect the other side of the button to ground
...
void setup() {
...
pinMode(PinRestartButton, INPUT_PULLUP);
}
void loop() {
if (stageStep.distanceToGo() != 0)
stageStep.run();
if (syringeStep.distanceToGo() != 0)
syringeStep.run();
for(int track = 0; track < 7; track ++){
if (stageStep.distanceToGo() == 0)
stageStep.moveTo(5000);
if (stageStep.distanceToGo() == 0)
stageStep.moveTo(1000);
}
while(digitalRead(PinRestartButton) == HIGH) {
//wait 'forever' until the button is pushed (becomes LOW)
}
}
Actually, you may want to make it a "start" button and put that extra while loop at the top of the loop().