Well, fortunately for you, that's something that can be done much more easily in code than it can be done in real life.
I'd personally define two states for each of your bullet-stoppers: a 'follow' state and a 'fight' state. They would decide which state to be in based on whether or not they can see any enemies and how far away they are from the player. If they are either a long way off from the player (unless you told them to hold position) or there are no enemies in their line of sight, they will adopt the 'follow' state and run through Raven's coding by means of an if statement.
If there is an enemy in their field of view and they're in a good mood to attack it, they would switch to the 'fight' state. This would cause them to bypass the AI to follow the player and instead let loose hell on whatever poor sap is in front of them by following some other code that causes them to shoot.
Of course, there are lots of subtle AI refinements that you can add to make them seem more life-like:
Instead of have a fixed 'distance from player' to cause them to follow you again, you could make them also assess how far away from their opponent they are and how much help you need from them. If you're not in any danger and they've got a very good shot at an enemy, even though you might be a good few meters away from your friend, he would still attack the hostile target.
Likewise, you could implement firing restrictions - prevent the troop from firing when all he can see is somebody's little finger about three miles away or stop him from blasting away even though the rest of the team are standing in front of him.
To be really impressive, you could even make a morale system. As troops get more panicky, they tend not to follow the rules quite as much - shooting at anything that moves or ignoring nearby friends when enemies are around.
Hope this helps!
"I am a living, thinking entity who was created in the sea of information."