key = [$game_map.map_id, eventID, selfSwitch]
$game_self_switches[key] = true/nil
$game_map.need_refresh = true
Replace "eventID" with event ID and selfSwitch with one of the four letters ("A", "B", "C", "D", with quotes).
Alternatively, if you plug in my
eventing script here, you can simply call the easy method as follows:
selfswitch(id, switch, true/false)