DMFI uses the OnChat check to link emotes with animations etc.... More than you ae asking for, but you can extract just the player chat script and functions.
I added a
few improvements to DMFI's chat parsing including eliminating the very long hangup on module load that 1.09 introduced.