Having the AI respond to and avoid danger is actually really, really hard, which is why it's not in yet. However, I hope to seriously tackle this problem in a couple of months.
Well I'm of the "post an idea even if it's stupid" because it might trigger a good idea or alter one already used.
If you broke the home area into sections then ran a point in that section through the Turret's targeting calls, wouldn't that yield a danger number for that section. Sector seven would be targeted by 4 turrets with 20 shots.
If the least dangerous path was greater than what the raiders wanted to tackle, they would switch to an alternate behavior. Perhaps a seiging sniping behavior waiting for the colonist to send out a tribute to send them on their way. The longer the seige lasts the more pressure builds on the colony to send them on their way.
If they had some resources perhaps they would try to find a way to interupt the power or attack the power couplings. Failing any of that switch to mining some of the metal away from the camp. If the colonists sit tight and holed up, they will be losing future metal.
Maybe the resources would be Combots, so the raiders don't really care if the robots get chewed up and they would attack to the last man.
Now this is bad, but what if the raiders had a mortar? They can just sit back and try to take out the turrets or power and then rush the complex. This would force the colonists away from static defenses and more into mobile fire teams.