The Z axis only moves up and down. If you want the toolhead to move left or right (which is in the X axis), go to the endscript and change accordingly. Usually, I have seen sample end scripts having G28 X0, which takes the toolhead to the home position which is safe, if you want to do something spl,...