I merged both your posts into one thread to keep things organized. To see how we formatted your code to make it more readable, you can click on the pencil icon in the upper right-hand corner of your first post and view the raw source.
In your first post, it sounds like you want to be able to stop running the movement sequence at any point in the script when the button is not pressed and resume where it left off when the button is pressed. Is that correct? If so, you would need to use an interrupt, which the Maestro does not support. You might consider using a microcontroller that supports interrupts such as an Arduino or an Arduino-compatible board (like the A-Star Programmable Controllers). With the microcontroller, you can handle the button triggers and send the appropriate commands to the Maestro based on the button's status. If you decide to use the Arduino (or A-Star), you can use the Arduino library for the Maestro to send commands to the Maestro via its serial interface. You can get a better understanding of how the library works by looking at its examples.
Regarding your second post, what subroutine number did you pass with the 0xA7 command byte to restart the script? Do you get the same error(s) if you send
0xA7 0x05? If so, can you simplify your code down to the simplest possible thing that should work, but does not and post it here? You might find the "Step Script" button in the "Script" tab of the Maestro Control Center helpful for debugging and seeing how each line of code affects the stack.