To write scripts:

Enter script text in the top pane of the script window.

Check for errors in script syntax by clicking the Compile button, pressing Command-K, or pressing the Enter key.
If there are syntax or spelling errors in the script, they will be highlighted and an error message is displayed.

After compiling, the script text terms and phrases are colored according to the styles set in the Formatting pane of Script Editor preferences.
Script text will also be indented to indicate the hierarchical structure of the scriptable objects used in the script.

Make any corrections, and compile the script again until all errors have been corrected.