VSYNC [ frames ]
VSYNC n will pause the program until n frames (screen updates, which happen 60 times per second) have passed since the last time VSYNCorWAIT was called.
If no value is given, it defaults to 1.
The main use of VSYNC is to limit the speed of your code. The 3DS's screen only updates (approximately) 60 times per second, so drawing graphics more often is pointless.
This program will flicker, and the filled area will barely be visible:
To fix this, use VSYNC:
VSYNC 'vsync after you finish drawing
This will let the screen update after you're finished drawing. Otherwise, you'll end up clearing the screen before the 3DS has a chance to display what was there.
If you want your code to run at 30 FPS, you can use VSYNC 2. However, you'll have to use page swapping to avoid flicker.