The command "primaryWeapon player" will give you the players primary weapon.
The command "secondaryWeapon player" will give you the players secondary weapon.
If the player has NO primary weapon, the command will return nothing.
What you could do is....
player removeweapon (primaryweapon player)
player removemagazines (primaryweapon player)
....before buying the weapon.
The great thing is, even if you try to remove his weapon when the player has no primary weapon it wont give you an error.
The same thing goes for secondary weapons (LawLaunchers,AA Launchers, ect.)
As for actions there is no way to initialize them with arguments, so I think sticking with one script per weapon is the best thing to do.