Hm. I can't test it right now at work because I can't connect to a network here, but if I change it to work as an alias instead of on text event, it is working fine, so it should work in the on text event as well.
Try putting this right above the echo line in the script:
See what you have there. %c should be forward and %b should be backwards.
Is this the only on text event in this script file?