>>64095426
Probably depends on the detection method. The system I'd go with is a combination of EOTS and UFODAPs preloaded with data relating to drones, rockets, etc. Whatever it is it needs to see in a dome and have a system that rapidly IDs. Maybe some sort of AI integration for faster ID? Biggest reason I'd rely on a shotgun, even if it's just something like an modified AA-12 on a mount, is the thing can start firing before it's on target just dumping metal into the air. You don't have to be dead on to hit something with a shotgun and it's really hard to fly through dense lead or steel shot. Once it's on target the shotgun will win without question.
A smaller gun system is important because it's going to be easier for it to be aimed faster. An M-230 is not a light gun when you factor in all the gubbins it'd need. Ammo capacity could also be an issue. For the desired purpose it MUST be fast to swing around and get on target. This thing has to do two primary things. Shooting the drones before they can hit and making it so drone operators don't have time to line up a good hit. Idea is if it does hit it's less likely to be a bad hit because the drone is racing the gun. Coupled with some sort of microwave emitter with a suitably wide emission area could be especially effective.
Btw, I'm not saying we shouldn't put an M-230 on a tank, it's one of the reasons I really like the AbramsX. What I'm saying is for this specific purpose you need a different weapon better suited to the task. Personally I think that is an automatic shotgun, especially with a high fire rate.