My son started social group therapy and the word they use for this kind of "stuck" is rockbrain. Before, he never understood what it was and the problems it caused. Now, it's a code word for unstick. I say "rockbrain" and he understands what he's doing and tries if get it under control.

It has also helped to set a boundary before we go out-- one major boundary is that I won't tolerate public scenes. A scene in public can be unsafe, disruptive to others and just plain embarrassing for the whole family. If there is a public scene, we will leave and when he calms down, he can expect a major consequence

I think for kids who get "stuck" (mine has ADHD) they need to know ahead of time what the expectation is, be cognizant of the kind of thoughts/ behaviors that are warning signs (in this case rockbrain) and have coping skills to stay in control (counting, deep breaths, in my son's case, when possible, he leaves the area for a few minutes).