Your "On start of layout" event should activate the groups that need to be activated and deactivate the groups that need to be deactivated.
In other words, your own initialisation of the logic of the event sheet as you expect it to work on start of a new level/layout.
You can put all those actions in a function and call this function on start of the layout.
In the same order of idea, you can "clean up" in the "On end of layout" event to disable groups that need to be disabled/enable groups that need to be enabled.