accelstepper help needed

I've never used accelStepper, but from the look of your code it will move to 100, then instantaneously move to 200, then 300 etc, without a pause in between individual movements, so it will appear to move directly from it's start position for 500 steps. (And it will keep repeating that indefinitely.)
Edit: And I don't think they're absolute positions, I think they're relative to the start position.
(But I might be wrong about that.)
No, on closer inspection, because it's looping, it will start a movement, then loop until the distance to go is 0, then depending on where in the loop it is at that moment, it will begin another move. End result is similar to what I first described, but even more out of control.
(I'm getting tired and slow. :frowning: )

And this:-

if (stepper1.distanceToGo() == 0)

appears to be a check to see if the stepper has finished a move before continuing with the following statement.