Delayed echolalia, or scripting, is when someone repeats language they heard minutes or weeks earlier. Ming @ Agents of Speech explains it as a form of verbal stimming common in autistic people, often used to soothe or cope, and argues understanding why someone does it matters more than stopping it.
Chapters
Let's talk about delayed echolalia. And this is something what a lot of people call scripting. Remembering something from a few minutes back or a day before or maybe like two weeks before where they've seen something very interesting and they learned it and now they are rehearsing it and scripting it as if they're trying to remember and rehearse it. When we're learning a new language, the first things we do is to imitate what our teachers say. But you have to understand that might be what we call verbal stimming, which is something that autistic people do. And actually stimming isn't something that we should stop necessarily, it's something that we all do but we stim in different ways. And people might argue, is it a coping mechanism? Because sometimes when it's stimming, echoing might be something that soothes or calms down autistic person or anyone to be honest. And whilst this happened, it's not always the case. So you have to get down to the why of stimming.