Ok, a few things with your code;
When you put in Sync On, always put it at the very top of your program along with all the other loading things, like loading images, music, setting up arrays, loading dll's etc etc.
Then, once you've loaded everything, you put in the first commands that actually do stuff, for example, in your code, put in the Print commands after you have loaded everything...
I can also see that you haven't quite progressed onto Functions yet, so, where you have the main Do...Loop, take out the DO and replace it with a lable ie, "reset:" ( Without the inverted-comma's ) and take out the Loop and replace it with "Goto reset" ( Again, without the inverted-comma's ). What this does is basicaly the same as a Do..Loop ( For those of you that are into functions etc, yes, there are many ways that are better to do it than this, but it's his first program, give him a break ).
Also, where you have the Until command, you don't quite have it set up right. Where you have: "until get ground height(2,500+x,z) 10 then EXIT" it should be: "until get ground height(2,500+x,z) = 10" ( Again, without the inverted-comma's ).
Now, for the actuall problem that you required help with, the pause.
The code that I provided:
If SpaceKey() = 1
While SpaceKey() = 1 : EndWhile
While SpaceKey() <> 1 : EndWhile
While SpaceKey() = 1 : EndWhile
EndIf
can go anywhere in your loop. Ie, anywhere between your Repeat..Until loop.
I suggest putting it with the other keyboard commands just to keep your code tidy.
Then, run your app, and hit space, and it should pause.
Hope I Helped...

Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy