Actually, Carol was fighting walkers. She didn't disappear. She and T-Dog got right into the thick of that, shooting walkers as they tried to get to that door to get inside the prison. T-Dog realized the gate was open and went to close it - Carol kept shooting walkers to clear a path to the door. When T-Dog is bitten and they show Carol's reaction, you can see that there are still walkers around her as well. If she hadn't kept clearing a path to the door, then she and T-Dog would both have been killed by the gate because they would have been surrounded and didn't have enough ammo.
There really wasn't anything more that any of them could do because they were caught by surprise. They had cleared that section of the prison and secured all of the gates so they felt safe. They thought Andrew was dead and were not prepared for him to open those gates and leave bloody deer meat to draw walkers inside - or for him to set the alarms off to draw more walkers. Being caught by surprise like that, they had to act quickly and didn't have time to plan any kind of strategy. There were things that they all could have done differently, but we can't really say that would change anything for the better. Different actions could have resulted in more people dying.
For Carol specifically, I think that was actually a huge improvement. When they were caught by surprise like that on the farm, Carol fell apart and was no help to any of them. This time, she fought back and took out quite a few walkers.
no, rewatch the episode. Carol was not clearing out anything while t dog was closing the gate. She ran through a door and disappeared. After T got bit, she ran back out and screamed. that's why there were no gunshots when T got bit. Carol had already escaped into the room when she was supposed to be watching T-dogs back.