This is what happens today - leaving and re-entering ALT mode while a script is running ends up with both the script and CHDK alt mode handler processing the button presses.
Yes, and the current behavior is unintended and bad, IMHO.
If we're going to make entering / leaving alt while a script is running have a well defined behavior (a good thing, IMO), we should focus on making it useful and consistent, not preserving the way it ended up by accident.
I agree it is not ideal and potentially confusing - what I'm suggesting is a way to both keep the current behaviour, and access the better behaviour while also providing an on screen indication of the difference.
I am
definitely not in favor of keeping the current unintentional, poorly defined behavior in the name of backward compatibility.
If there is a need to access CHDK settings while a script is running, we should implement it in a way that's actually useful. Without a way for the script to detect this state, the usefulness seems extremely limited, while the scope for additional confusion, corner cases and bugs seems large.
This is not symmetric with keys going to the Canon UI, because script *can* detect whether it's in alt or not. It wouldn't be terribly hard to make script able to distinguish between <scr> and <alt>, but I'm not convinced there's a need that justifies it.