There is no "Stops Touching Me" event, depending on the situation I would do something like this:
PHP Code:
function onPlayerTouchsMe() {
if (this.ani != "walk") this.setcharani("walk",null);
setTimer(0.25);
}
function onTimeout() {
this.setcharani("idle", "");
}
Provided the player continues to touch the NPC it won't timeout (because it will keep getting reset to 0.25) and go to the idle position. Maybe adjust the timer to suit your needs though.
Edit: Well... Timeout, scheduleevent, same difference.