switch="0" - is just a variable for the IF action to comare against.
onover="openmap();" - this would be an action that works with your mouse on a PC it will have no effect on touch screen devices. opens the map without clicking
onout="closemap();" - this the opposite of above
onclick="IF(switch == 0, openmap(), closemap()); - this will toggle the clicks. and is a way to oepn and close the map by clicking the same icon. which will allow the map to be opened and closed on mobile devices that do not know about onover and onout.
the first click the IF statements checks the state of switch it is 0 so it will run the action openmap(). notice that the action open map when run sets the switch="1", the next time it is clicked it checks the state of 'switch' which is now 1 because openmap set it to 1. since it is now 1 switch does not equal 0 anymore and will now run the second action closemap() which will in turn set 'switch' back to 0 so the next time it is clicked it will reopen the map.
<action name="openmap">tween(plugin[map].scale, 1); tween(plugin[map].alpha, 0.85); set(plugin[map].switch, 1);</action>
<action name="closemap">tween(plugin[map].scale, 0.25); tween(plugin[map].alpha, 0.25); set(plugin[map].switch, 0);</action>