You have the reference to the "Single Pass" button control. You will find an "Enable" property for this.

Set this property in the "StartExecution" to "False" and in "EndExecution" back to "True". Both are callbacks you have to define. They are message events from the ApplicationManager.
hope this helps,
Norbert