I saw an interesting theory on how Bruce got back into Gotham on IMDB. I'll just paste part of the guy's post here:
We see Barsad (Bane's second in command) on the bridge talking to the army captain(Bunny from the Wire!). The officer says Bane's men don't have enough to cover the entire city perimeter. Barsad replies "no, but you do".
So the army's job is to keep people from getting out, but isn't it obvious that they would let Batman in?