You can edit a script and set its execution properties in the Properties dialog:
Active: Activates or suppresses the script. Only active scripts can be executed.
Update mode: Determines when the script is executed. Possible options are:
On Triggers: Execute when updating the model, if a parameter or the script has changed.
Manual: Execute only when instructed by the user.
Always: Execute on every model update.
Source: Contains the Python code to be executed.
In addition to the default buttons (OK, Apply, and Cancel), the Script has a Save button which saves the modifications without closing the window or updating the model.