The reason I'm looking into this is because I'm fed up of NPCs wandering around saying saying "I guess I was just hearing things!" while at the same time having an arrow stuck in them that I've just fired while in sneak mode. I just want to make a lightweight mod without any scripting that gets rid of this irritation.
So far, I've added the condition that the NPC is not injured. If the NPC is injured, then they will not say any of the dialogue such as "Guess it was nothing after all" when going from alert back to normal when they still have an arrow sticking out of them.
However, one thing this doesn't fix is when there is more than one NPC standing next to each other when attacked with an arrow. The NPC that is injured won't say the dialogue, but the other one will still say it - despite his fellow bandit having an arrow sticking out of his neck.
I tried adding the condition GetLastPlayerAction!=3 (ie. last player action was not firing a bow) as a condition for the dialogue to trigger (because I don't want to block it completely - I want it still to be possible to be detected by means other than being hit by a bow and to still hear the dialogue then), but testing results have been inconclusive - I can't figure whether it's taking effect or not.