you don't need a script. to make an event stay erased, just create a blank page with the condition "self switch (whatever) is ON." when you want the event to go away forever, turn that self switch on. "erase event" only works as long as the map the event is on doesn't get refreshed, but switches and self-switches stay the way they are until you change them again.