You do what the reg forces do you get as far away from site of ambush as possible, as they have had time to prep the area for your detriment. Staying and fighting is staying in a prepared kill box with funneling and secondary ambush points as well as no cover that cant been turned into a death trap.
in a crowd you surf the crowd just in from edges so you can break away when clear not in center so you get trampled or edges where you can be likely targeted. If more than one person in your group and you are not in same physical condition it can be a death sentence so have a secondary back up meet in case of separation with a time allowance then move again but who preps like that when going out to dinner.
If out side try to get inside with a solid roof know the difference between cover and concealment, know what out going and incoming sound like, count the shots. Use the crowd as a meat shield.
as for how detect if you are a target… unless you have crazy personal security you are up the creek without a paddle, just hope you are lucky or have a shitty sniper targeting you. With new types of targeting and optics software like this http://www.range365.com/american-sniper-wife-takes-on-world-shooting-champ-in-long-range-match you are basically done for, now an unskilled person can do the job of years , decades of training only thing they dont have is the how people react under such situations.
Tolik most of time you dont even realize till second shot if they are any good far enough away that the sound will hit factions before second round does. Seen crowds rush a machine gun emplacement but flee from sniper it is a mentality thing they think they can dodge a machine gun but sniper they fear they are the target.