Your plugin is really cool, it just has a problem.
The "Ok button clicked event" of the confirm dialog remains active on layout change. Let me explain:
* You listen to the "Ok button clicked event"
* Your action sends you to another layout.
* At some moment you go back to the layout where the event got triggered.
* Your action executes again on layout start
Is like if the event stood still active when you go back to the layout where it were triggered.
The solution is to simply make the "Ok button clicked event" a sub-event of the one that made the confirm dialog show up. That way, the event works as espected.