Thought of a new feature and a possible implementation last night.
Let's say you have three weapons representing the Subach SD-7 firing in different modes - normal mode, shotgun mode, and high field of fire mode. The Subach normal's weapon entry has an extra field, $NextMode, which would reference the weapon to change to when a key/SEXP is triggered. So normal would refer to shotgun mode, shotgun mode to high FOF mode, and high FOF back to normal mode. To ensure that no abuse of this feature occurs (e.g. avoiding the longer reload time for shotgun mode by switching the weapon twice), you have to wait for the value set in $Fire wait until you can fire the new weapon. You could also apply this to missiles - perhaps a swarm mode for Harpoons, or a mode that sacrifices damage for speed and agility.
Should it allow weapon modes with different ammo sizes or ballistic/energy weapons to be switched between? I'd say perhaps to the former and no to the latter. Different ammo sizes are easy to handle if the game calculates the remaining ammo integer in a primary bank on-the-fly, rather than once at the mission start (dividing primary capacity by weapon's cargo size). I don't think switching from energy to ballistic weapons would be realistic though; why would you load extra ammunition on a fighter that uses energy weapons? I'd leave this up to a modder's discretion, however.
As far as I can see, the code for doing this is halfway done - the cheat code that allows you to change your weapons.