I have lived in several warzones, and I can tell you how I survived.
>carry a red herring identifying you as a member of a neutral group
>if an attack is in progress, don't make yourself a priority target
>be near an exit
>if in the vicinity of at attacker immediately interrupt the attack without becoming a threat
>don't be somewhere that is likely to be attacked to begin with
Firstly you should identify as a non-target, you never know who will be targeted and in random attacks collateral damage is generally accepted by the attackers.
A random person is collateral- by identifying as a non-target you will likely not be targeted at all and will often be allowed to just walk right out of there.
Who is a non-target? The most common non-targets are women and children, culturally significant occupations (doctors, priests, bakers, postmen) On one occasion I just pointed at the tools of my trade and the door and the attackers allowed me to leave.
They were looking for enemies, and might attack random bystanders- but a identifiable and familiar person is immediately a non-target. "I just work here", "I'm a doctor", wearing identifying uniforms, carrying tools etc.
You would be surprised how far you can get just walking through places carrying hand tool, asking for directions and acting oblivious.
Secondly blend into the background, before and after an attack.
If you can't run then don't move, movement is the largest factor in target identification and anyone running is likely to be shot at by anyone under stress. In most attacks you are simply a bystander- and if you just freeze you will likely remain one.
On several occasions I have been witness to an armed robbery and simply continued doing what I was doing in slow motion and didn't make eye contact- then ten seconds later it was all over and I carried on my day.
Third is exits.
Forget about being close to cover, immediately after an attack the first casualties will be in proximity to the attacker, the second will be those unable to exit, the third will be those taking cover in the immediate vicinity.
Basically you know where the exits are and are ready to walk through them is something smells wrong.
Maybe ten seconds later you walk back in and say you were smoking or taking a call- who cares.
If someone shady walks in, I just walk out. As soon as someone is entering they are exposed to everyone inside, you can push out literally right past an attacker and they are likely to let you pass instead of fucking up their entry
Fourth is immediate vicinity.
If an attacker is about to kick off and you're withing meters of them exiting probably isn't an option and you are too close to be a bystander.
Even if you try to run the exit is likely to be obstructed by other people fleeing or concentrated fire from an attacker/secondary.
The key is interruption- don't wait for what you know is going to happen.
On one occasion someone came into a room armed and I immediately took two steps towards them and nudged them to one side while they were still scanning, apologized and walked out. The dude had no idea who I was or what just happened, and everyone was looking at him; and I was gone- instant spaghetti and the dude 360'd out of there.
The secret is moving against the attacker without appearing hostile- even if you point at the guy and ask him what color the moon is and start laughing, the more psyched up people are the easier they are to confuse. First everyone looks at you and you walk out; then they look at the attacker who is suddenly forgets he's a jihadi and is suddenly the looser who turns up at a party alone in a three piece suit.
Alternately you could try to 007 technique of using momentary surprise to get in range of an attacker, but they are likely so hyped up that the first one to touch them might get done first.
Fifth is about location/time.
Just don't be places that are likely to be targeted, and places where mass casualties are likely (if you can't identify more than one exit you should already be very aware of this). Places where identifiable groups gather are much more likely to be targeted because terrorists are interested in impact not casualty count. A strong factor in this is the number of people present. If terrorists could attack 30 people on a bus and kill 27, or attack a stadium with 300 people and kill 15 you bet they will attack the stadium.