One suggestion I noticed on your trigger that you have (!ucmd on|!ucmd off) could be cleaned up
on $@*:TEXT:/^[!]ucmd/Si:#: {
and call
if ($regml(1) == !ucmd off) {
those events with
if ($2 == off) {
Again just a suggestion, if anything its to make your code easier to read