It is possible to declare global variables that will be validated by the person executing the script.
A user can execute a parameterized script from the query or Solr directory even without having access to the scripting tool.
For more details on how these parameterized scripts work, see the help section.