The map rotation part should look like this:
where VAR1 to VARN are variable names MAP1 to MAPN are map names.
The set parts are just variable assigments, you store two commands:
map which sets the current map
setting the nextmap variable which contains the command to run when the nextmap is...