Imagine the following situation:
Batman is on a rooftop, having just disposed of a sniper. Standing over the assassin's unconscious body, he hears a scream. Looking around with his binoculars, he spots a mugging taking place a few blocks away. Things are quickly escalating out of control. The victim is in imminent and quite possibly mortal danger.
They're way out of batarang range, and by the time Batman swung/jumped/ran to the scene, it would almost certainly be too late. On the other hand, the sniper rifle, intact at Batman's feet, has the range, speed, and accuracy to make the difference.
Batman swore he'd never use a gun, but it could be the only way to save the victim's life. But it's not a weapon he's used to. He has the hand-eye coordination, but not the experience. Closest thing he's used is the grapple gun. And the simple fact that he hates the weapon so much could potentially affect his ability to make an accurate shot.
He would take the shot and hit the guy in the shoulder for a takedown. He may hate guns, but he does use them in Batcave when he is doing CSI type testings on evidence.
Check out Batman Year Two (Detective Comics 575-578) Batman resorts to brandishing a gun when he is almost beaten to death by a character called the Reaper. Batman only uses it to disable not to kill. The story is pretty good Bruce proposes and Batamn has to teamup with Joe Chill,the man who killed Bruces's parents.