The code is a little misleading. Basically, you need to make sure that you reset the screensaver setting before you exit your program, as it's a system-wide setting - something like this:
sync on
disable escapekey
SetScreenSaverEnabled(0)
repeat
cls 0
print "Testing screen saver enable."
sync
until escapekey() = 1
SetScreenSaverEnabled(1)
end
function SetScreenSaverEnabled(enable as integer)
local itemp as integer
local user32dll as integer = 1
while user32dll < 256 and dll exist(user32dll)
inc user32dll
endwhile
if user32dll > 255 then exitfunction -1
load dll "user32.dll", user32dll
itemp = call dll(user32dll, "SystemParametersInfoA", 0x0011, enable, 0, 0)
delete dll user32dll
endfunction itemp