on some places, when you walk, you have an ambush of rangers (the CaH ability that fire on the unit in the center of the circle
I think the best way would be to create a trigger area. Your script will determine if units are inside it, then drop the object used by the summon, and start a timer that will prevent the script to activate itself again for a certain time.
the rangers have to attack only evil factions
I would create a new team for the rangers and create scripts, that find out the faction of each player and set the alliance afterwards.
If this should also apply for the units summoned (the ones in the circle) it is much more tricky, because they automatically belong to the standard team of the controlling player. You have to either create a recursive script that finds all units spawned and change the team of each of them to the desired team. Another posibility would be to give all good units a special KindOf per map.ini, and to change the weaponset of the rangers such that they use a weapon, which deals no damage against this KindOf.
One other possibility I see would be to work with capturable flags. You have to make every unit of them capturable on their own, and give each of them a flag (moving with them), which can be ownly conquered by good factions.
The same can work of course, too if you use instead of the capturing by flags the on of settlements and outposts. But then you have to have always supporting units nearby such that they won't change to neutral again.