
Enter adds the end a block needs
Press Enter at the end of a line that opens a block, like a function or a for, in a ShotScript tab in ShotScript Editor, and the caret goes to a new line one step in. When the block has no end yet, its end comes too, on the line under the caret. A block that already has its end doesn't get a second one, and a case in a match gets none.
The script
In a new Baseplate we made ShotScript out of a plain Script called Menu in ServerScriptService, with ShotScript Explorer's right-click Mark as ShotScript. Its text stayed as it was.
type Course = "Soup" | "Tart"
local courses: { Course } = { "Soup", "Tart" }
local function listCourses()
end
listCourses()Every key below was pressed one at a time, and we never typed an end ourselves.
An empty block keeps its one end
We clicked at the end of local function listCourses(), whose end is on the next line, and pressed End and Enter. The caret went to a new line one step in, and the function kept its one end, now on line 7. A fold arrow appeared beside line 5.

A new block gets its end
On that line we typed for _, course in courses do and pressed Enter. The for got an end of its own, lined up with the for, and the caret sat on the new line between them, one more step in. The function still had one end.

A case in a match has no end
On the new line we typed match course. A list of names opened as we typed, and Esc closed it. Enter gave the match its own end too, with the caret one step in.
There we typed "Tart" then and pressed Enter again. A case runs to the next case or to the match's end, so it needs no end of its own, and Enter added just the one line, with the caret one step in from the case.

That left one end for each block, the match, the for and the function. The blue wavy line under match on line 7 is about the match itself: a Course can also be "Soup", and the match has no case for it yet. Holding the mouse over it shows this:
ShotScript Warning: match on Course has no case for "Soup": add the case, or an elseIt has nothing to do with Enter.
