Try like this:
edit: just to make sure everything is working from your code: try something like this with expressions: Support for Script Implementation on Messages Events
Try like this:
edit: just to make sure everything is working from your code: try something like this with expressions: Support for Script Implementation on Messages Events