Sounds like what you are describing is a custom function. You can create your own functions that can be called with the parameters that you specify from within a script.
There is a FileMaker script equivalent to GoSub. It's Perform Script. You do have to write a separate script not include the steps in the same listing, but the results are the same. You can even pass a parameter to the performed script which might help the function of your repetitive script task.