Well, I think that would be very usefull a script command to avoid the player using any command @. It can be like a pc_blockcommand,0; for unblocked and pc_blockcommand,1;
Or a blockcommand; that will avoid using commands while talking to npc.
I'm saying this because anti ahk / bot scripts are easily bypassable, as the player can simple use a @warp command to close the npc chat. ( I know you can't write it, but if it's on your alt + m, its usable )