The commands are the "meat" of your script. You specify a single command on each line. These will be sent to the server when the script is run, after some processing. The processing allows you to add "variables" inside the commands which are replaced with the "variable" values before the command is sent. Those variables are specified by a dollar sign ('$') followed by the variable name. The processing then looks for this pattern and replaces its occurances with the value of the variable.
Let's look at some examples to get an idea of how it works:
tell Gorgonian Hello
tell $sender Hello
tell $sender What do you mean by "$message"?
Note that if you use a variable that isn't defined, it will not be replaced and will be sent as specified, in its "$variable" form.
A list and documentation of the variables (such as sender, message etc.) you can use when writing scripts for various event types/subtypes are available here.