This is partially solved. I’ll show the partial solution here and open a new topic for the remaining issue.
The Script Console in the Designer executes the script in the Designer scope.
I added the script module in the gateway hook, because it will be a gateway script.
I was attempting to use the script module in Script Console.
Adding the script module in the designer hook class makes the class visible in Script Console.
I was only able to make this work if the namespace is a subset of system.
Note to technical writer:
It took me quite a while to realize that the class name in the module code is not visible at all in the script environment. The namespace/location parameter is effectively the class name.
I was thinking that one location could hold multiple classes, addressed as: location.class. Not true.
Note to gateway system programmer:
Seems odd that when a second class is added to an existing namespace the script manager would merge the classes, instead of writing the second one over the first, or ignoring the second, with a warning.