I'm not sure Gill was just guilty of incompetence - wasn't it more like, even when she knew the extent of corruption in the police force, she made a decision, for PR purposes, to help to try and cover it up? Or maybe it was more sinister than that - it was left a bit in the air, possibly to be re-visited in the next series, together with the identity of the person for whom Dot was working.
I think the final shoot out was to demonstrate that so many levels of the force had been corrupted, even the firearms team. I think it was also to show that people even higher up than the local bigwigs were involved in the the paedophile ring and that they would use all power at their disposal to prevent their involvement being revealed. Makes you wonder doesn't it.