Unfortunately, Kyle has got a real problem as I had it too. The problem with global variables is that you can't vary them through the AddAction.
How to explain: I have a generic artillery script where the ammo types (e.g. HE or smoke), battery size etc. are passed as script arguments. (global variables are involved though derived from OnMapSingleClick). Originally, I exec'd it from radio triggers say:
[HE,6] exec "arty.sqs"
Being lazy, AddActions looked a lot easier than setting up radio triggers. But the arguments don't work (same problem with the script box for scripted WPs) you can't do:
_fireHE = player AddAction ["HE - fire for effect",[HE,6] exec "arty.sqs"]
Tried it with curly brackets to no avail.
The only workaround I could come up with was, for example:
_fireHE = AddAction ["HE - fire for effect","artyHE.sqs"]
as the addaction, where artyHE.sqs was a two line script that exec'd the actual arty code:
[HE,6] exec "arty.sqs"
exit
And so on for other ammo natures.
Support for script arguments in AddActions and Scripted WPs is on my OFP2 wishlist.
Sorry, I don't know of any other way, but I'm keeping an eye on this in case . . .