I think some time ago we had this problem - it is general...
There are commands, and I also think functions, where
- you might wish to define per option(s) for the cmd/func how to react in case of some error (yes: ESC is kind of error, too)
- how such an error might be signalled to the script
(Also for functions, especially those returning text, it's not good to return an error by some text: it's easy to misunderstand this as valid return value.)
So I think use of XY internal variable(s) to signal return code and descriptive text would be the solution.
I would prefer if this wouldn't be solved command by command, but in general.
(Though maybe implemented command by command

)
As long as a script doesn't signal that it will handle errors, it's OK for cmds/funcs to abort script for errors that might lead to "strange" situations.
E.g. a script renaming (with move

) shouldn't delete folders, if the rename has been ESCaped...