About This File
This is a small plugin which will not be developed further. The source is attached, you can modify it and recompile it yourself if you're interested.
If GMs turn your mob green, this plugin *should* recognize that your enemy is no longer attackable, stop the fight, turn around and walk away a little, then say something in chat before pausing the bot for a few seconds and moving on its way.
For specifics, check the source. The IsEnemy() method can probably be changed to contain UnitIsFriend (Lua) in case GMs use a different method that makes the bot think the target is attackable even if its faction is friendly to you. In that case, you might need to also change it to check for specific NPC flags. But this would require knowing exactly how GMs test for a bot.