The following example sets the task to inactive. This will prevent the task from executing the rest of the task (but not the next line of the script).
Sub Main
CurrentTask2.Active = 0
End Sub