My suggestion would have your code in LAi_events.c search for a "shottype" which can be defined for each type of gun. Because your ifs use "pistol#", they won't work for guns that have a quality, because quality is added to the gun's name as "+#".
(# means any random number that is appropriate)
Of course, you could add a large number of "pistol1", "pistol1+1", "pistol1+2", etc. (not sure if this is exactly correct, but you get the point), but that would make for a very annoying code with ifs with dozens of arguments. Better having one if search for the shottype flag. You would just have to add it in initItems.c. Look at the code for disarming with blades (search for "PB" in the code) to see how it can be done. If you don't manage yourself, I'll try to give you a hand. But I reckon you'll be able to do it. I managed to add the disarming chances eventually, even though the disarming mod itself isn't working too well.