Conditionally prevent execution of a script