Maybe i can explain a bit better.
For what you asked, select in S3D the option where it uses Process1 to print model A, then goes to Process2 to print model B. You can choose this on the pop up once you hit slice.
The code G1 X10 Y5 is simply telling the hot end to move out of the way. The numbers justs tells it where to "park". You can enter whatever coordinate works for your case.
M0 is the actual command to pause the print.