If I wasn't at work, I could give you specific information on how to do it. I'm not sure about the following syntaxt, so feel free to correct me if I'm wrong.
There's many ways of doing the thing you want, here is one option. If anyone has another way, post.
Look at the spawnmanager script which spawns the enemy units.
At the start, add the following: _spawnedunits = []
Then find the line which creates the unit, it's something like: "_unit" createunit [_pos, _group...etc etc...
If there isn't already, edit the line so that it's something like: _soldat = "_unit...etcetc...
or, alternatively, you can give the unit a name. To do so, you need to add the name to the init line. It's the third one on the line, here's a caption of the line from the offcial comref: [pos (Position),group (Group), init (String), skill (Number), rank (String)]
So, in this case it could look like: "_unit" createunit [_pos,_group,"soldat = this",_skill...etcetc...
Still with me?
Using the first option with the _soldat line at the start, after the creation line add:
_spawnedunits = _spawnedunits + _soldat
Then, before the script exits, execute the custom weapons script on the array, like this:
"[_x] exec {customguns.sqs}" foreach _spawnedunits
Or, using the second option by naming the unit from the creation line, soldat = this, execute the custom weapons script after the creation line, sth like:
[soldat] exec "customguns.sqs"
If this was hard to understand, I apologize. It's 9am here and I'm at work so I can't use my stuff as reference.
If no one else responds after I get home, I can give you more information if you need.