Challenges I see:
* scripting can't do 1st/2nd weapon swap input
Closest to inventory handling you can get with the commands is with update_inventory.
container_type_class="equip" is not wired, but you can still achieve the same with container_type_id="4". Now, I have no idea if that results in anything sensible, it hasn't been tested and it hasn't been intended to work. Omitting add="1" will attempt removal of said item type.
* tracking bullets left in a weapon
Every bullet shot isn't reported to the scripting side as events, so you'd need to do periodical monitoring of character data and examine the weapon state. Too bad it doesn't seem to be possible either, as per character the scripting can receive data such as id, name, position, block, dead, faction_id, xp, rp, leader.