Have you taken a look at questions taggedskwin-scripting here?
There are all four of them and two (besides this one) are asking about very similar thing. I think you will find answer there.
I have indeed. The script entered via the console doesn’t have a name I can see, so I can’t use unloadScript. So that’s a no.
That prompted me to explore dbus, where some nodes with “Script2” to “Script46” were. Using unloadScript(“Script46”) didn’t really work.
There’s Script46/stop, but who knows what it does exactly if it doesn’t unload. It kinda seems to work-for-me now, but I’d prefer someone to point me to actual documentation if it exists.
And if not, then I want to check here before filing a bug against the docs.