Your problem that DB is having is that there is no 'loop' command to close the 'do' command in line 1. Your problem is that you shouldn't have a 'do' command in line 1, because there is no reason for it. If you re-read the tutorial, from the beginning, I think you will find that there is no 'do' command there. The working code is as follows:
sync
Rem Make Bat 1
make object box 1,1,1,3
Rem Make bat 2
make object box 2,1,1,3
Rem make ball
Make object Sphere 3,1
Rem Colour Bats and ball
Color object 1,rgb(255,0,0)
Color object 2,rgb(0,0,255)
Rem Main Loop
do
Rem allow movement for player 1 bat (W and S)
IF keystate(17)=1 AND p1z# < 5 then p1z# = p1z# + 0.2
If keystate(31) = 1 AND p1z# > -5 then p1z# = p1z# - 0.2
Rem allow movement for player 2 bat (Up and down)
IF upkey() = 1 and p2z# < 5 then p2z# = p2z# + 0.2
IF downkey() = 1 and p2z# > -5 then p2z# = p2z# - 0.2
Rem Position Things
position object 1,-5,0,p1z#
position object 2,5,0,p2z#
Position Object 3,0,0,0
position camera 0,10,-10
point camera 0,0,0
sync
loop
Hope this helps.
[edited for typos]
Part of solving the problem is actually noticing that the problem is there in the first place