1. A generic "assignMagazine" command would be useful. It would pick the magazine from the player's inventory, and assign it to the correct (open) weapon magazine slot.
player assignMagazine "30Rnd_65x39_caseless_mag_Tracer";
2. Another (more refined) way to implement it would be with 3 commands: "assignPrimaryMagazine", "assignSecondaryMagazine", and "assignHandgunMagazine"
player assignPrimaryMagazine "30Rnd_65x39_caseless_mag_Tracer";
If passing empty string to the command, it would clear the corresponding weapon's magazine slot.
3. Or finally, make the "addMagazine" command automatically assign the magazine to the correct (open) weapon magazine slot.