While it can be very difficult in practice, I'll give you the theory behind variable sync frequency.
In a typical game, about 99% of the lag is created by actually rendering the scene - SYNCing (You can use TIMER() comparisons to test this if you'd like). Knowing this, you can influence the overall game speed by modifying the frequency of the SYNC command.
The gist of it is:
If the game is too fast, you call more SYNCs (and perhaps put a cap on the FPS if you have a really fast game).
If the game is too slow, you don't call the SYNC command until sufficent game time has passed (if your game is really laggy, you may consider after a certain point forcing a SYNC every quarter-second or so, thus slowing the game speed but making it more playable).
Now, actually determining how to go about deciding when to SYNC or not is difficult. I have yet to code a completely accurate frame limiter. You'll need the TIMER() call at the very least to do this.