G1 X4 F600 moves X off of endstop 4mm. What is the next line,G1 X-10 S1 commanding? Go back towards endstop 10mm? I'm confused. Sorry if it's a stupid question.

I added Line numbers and will break it down line by line as best as i can, Lines 1 and 7 I done have coimplete under the hood understanding of so it may be wrong on those.

(1) Set Printer into Relative mode, moving relative to current position not from origin(endstop)
(2)Move Z 4mm away from the nozzle for safety clearance at a feedrate of 200
(3)Move the X carriage toward the X endstop at a feedrate of 3000 and a distance further than is actually possible to ensure that the endstop will be pushed when homeX is enacted all while "listening" for the endstop to be pressed, and when pressed stop
(4) Move away from teh X endstop 4mm at a slower 600 feedrate
(5)again move toward the X endstop at a very slow feedrate of 200 while "listening" for the endstop press. the extreme slowness gives a more accurate endstop press location.
(6)Move the bed back toward the nozzle 4mm now that all X motion is finished
(7)enable Absolute mode so that all motion is based off of origin(endstop) location