In a gamemode block, and running it in an onhit player block, is that the former checks for the conditions every frame, while the later will do it whenever the player attacks it.
In other words, its this:
Frame 0000: am i hostile? -> no
frame 0001: am i hostile? -> no
frame 0002: am i hostile? -> no
frame 0003: am i hostile? -> no
...
frame 9921: am i hostile? -> yes -> run code
vs this:
Frame n: Player shoots npc for the first time -> am i hostile? -> no.
...
Frame z: Player shoots npc for the nth time -> am i hostile? -> yes -> run code.
It's checking every frame for iscombattarget and will drop out if its false, that's sorta like, no big deal... If I really wanted to optimize, I could put it into a startcombat player block, which I very well may do..
Bethesda's handing on deciding when to have the NPC become hostile is less error prone than what I would throw together in script code, and its all hardcoded, which means its going to be efficient and fast...
If your guy is playerteammate I believe, or has some close relationship with you to where you are fighting together (im not positive all the conditions that apply, it may be more than just playerteammate), you can make, I believe, an infinite number of accidental hits and nothing bad happens. If you are screwing around and shooting the NPC a couple of times, it lets you hit like, 5 times or something, and then it even lets you 'yield' after that, unless like in Arcadia's case I force a faction change for a specific effect.
Sorry but I don't see what you guys don't like about doing it that way. I like how well that works, and how it won't make mistakes, and how its all in the executable so its fast, and how it doesn't require attempting to rewrite all of those conditions and all of that intelligence into script code. It's all right there already, thanks to someone else's coding. If they write code to do a specific job and that code is well-weathered (I read this behavior exists in Oblivion), I'll want to want to avail myself of it when the opportunity presents itself.
Having said that, I wish they'd put my distance-based-weapon-switching-script code directly into their executable... it actually svcks to have to put script code in place that overrides code in the executable. It svcks, its conflict-prone, and is non-optimal. I only did it because it was necessary and scripting was the only tool available to me.
How someone wants to do it in their own creation is up to them obviously. I'm replying at this point to express that there are sometimes benefits to doing things the way the game's designed to handle it (this way).