If you're going to only allow your own chat messages anyway, just use the following procedure:
package foobar
{
function NMH_Type::send( %this )
{
%value = %this.getValue();
if ( %value $= "hi there" )
{
%value = "Hey. The message detection is working.";
}
%this.setValue( %value );
parent::send( %this );
}
};
activatePackage( "foobar" );
Execute this, start or join a game and type "hi there".
With this script, set %value to "" to block the message from being sent and set it to something else to send that instead.