Much better now!
-) Misspelling: Freindly
-) Misleading "friendly" in many descriptions. All variables have nothing to do with allied players.
This condition does not do anything useful: !!FU&i^dark_enabledForAI^=(FALSE):E;
The whole logics of dark_enabledForAI seems to be unclear.
Check for AI should be done via OW:I(player)/?(isAi:y);
-) ; Jump to the next hero if hero is in the same team with current player
Obvious comment. !!co is jump, the condition is trivial.
-) !!HEi:O?(owner:y);
!!OW:T(owner)/?(heroTeam:y);
Check for NO_OWNER and continue. Do not get team for heroes without owner.
-) Separate break commands from the rest code, they are flow control structures (important things):
-) !!UN:U(OBJ_HERO)/i/-1/?(x)/?(y)/?(z);
That's wrong! UN:U searches for N-th object on adventure map, many heroes are not on adventure map and besides, you already have necessary hero ID.
My congratulations. Your coding skills are improving from day to day!
This script is really modular, clear and reusable.