I'm no expert addon maker but I have created one or two stupid weapons for my own amusement (a 9999 shot autofiring LAW anyone ?).
I noticed in my travels that an addon can be configured to either include scripts for player use (addActions) or to run a script whenever it is fired. For your proposed weapon all you'd need to do is create a weapon with multiple "barrels". You then give each barrel a new ammo type with unlimited ammo (cf Binocular, NV Goggles), then have it run a particular script each time that the weapon was "fired".
The problem is trying to get access to the underlying object characteristics so that you can manipulate them. I don't know how they work but I've seen in the configs references to textures, materials etc, which apparently can't be referenced in any way by the scripting language (ie via .sqf's or .sqs's). Someone much more skillful then me might be able to help you here - I understand that the config files are all written in some for of C, perhaps the idea is to include a C sub-routine inside the pbo.
Alternatively, you could simply have the addon script just set some sort of public variable that your mission specific script could pick up and use.
Example - Toolbox weapon barrel 3 = "Hammer". On use it runs animation "UseHammer" on the firer (included inside pbo), waits a few seconds, then sets publicVarable "hammerTime" to 1. Anyone who wanted to use that could have a script running that picked up that varaiable and checked for the nearest building, then dealt a specified amount of damage to one or more particular types of objects (say, buildings, but not trees).
Good luck !
Roni