When you assault a region full of enemies, it’s prudent to plan an escape route, or alternate cover spot, before the attack. At the very least, know where your immediate foes are positioned at all times so that you can evade effectively.
If enemies are on your heels, forget about your sniper rifle and switch to your backup pistol.
The pistol is better at close range and can get off more rounds than your rifle in a short time period.