This does not actually move to the given side instantly, nor automatically. Instead, it appears to set an internal flag which is later used in the loadMap function. The flag may be checked at the end of event handling. More investigation is required.
Code actually only accepts 0 or 1, and does nothing otherwise, but should be easy enough to extend to support multi-world games.