If you want to create functions then create scripts in the script section of the editor. Leave them as definition type scripts so that they are defined & can be called as soon as the game is launched rather than having to be manually called in.
Now to call/update functions you can create execute a script actions anywhere in the editor where you can create action parts. Anyway in those you can just type the function name you want to call...
Here's a quick example of a function with input variables...
Add this as a definition script.
for i = 1, n do
Now you can call & execute this function inside of an execute a script action part or from another script or inside of another function..
test("I should not swear at the teacher.", 10) -- will write "I should not swear at the teacher." 10x to the log