Quiz mode is a prerequisite, not an assumption
Before any grading script can write scores, the form itself must be in Quiz mode. Open the form in the editor, go to Settings, and confirm the 'Make this a quiz' toggle is on. Without it, getGradableItemResponses() returns an empty array on every response and your script exits silently with nothing to show for it.
With Quiz mode on, each item that carries a point value becomes a 'gradable' item. The script calls getGradableItemResponses() rather than getItemResponses() because only the gradable variant exposes setScore() and setFeedback(). The two methods look similar in the docs; the wrong one compiles fine and does nothing.