In a Script Editor, there are two ways to save a script:
If your code has syntax errors, a highlighted message appears. If there are no errors, the name of your script appears in the upper right pane.