If you don't need access to the CLI, you can try using LOCK CLI at the top of your program. That will run your code but bypass the CLI on your code's exit. This will rotate a cube for about 2 seconds then exit the program without going to the CLI:
Set display mode 800,600,32
sync on
sync rate 60
lock cli
make object cube 1,25
tim = timer()+2000
repeat
turn object left 1,1
sync
until timer() > tim
end
Also, there may be information here:
Getting started with DBC that will help you address display problems.
Enjoy your day.