I don't quite have the time to look through the whole script, but in response to:
"Passing it the values which change", by this do you mean instead of having one section for firing of each shell, there would be one section for all shells and in place of "shell", "shell_5", "shell1" etc. there would be a general value that changes depending on what type of artillery is selected in the radio menus?
The answer is almost certainly yes. It sounds as though you need to run your script with different parameters according to what shelltype the player selects through the radio menu.
Every OFP script has a reserved variable _this which represents the parameters entered into the script. That's what can make the same code provide different results. If _this is an array (and it almost always is), use the
select command to return each element of the array.
So if I have a script, "teleport.sqs", that says
_teleportme = _this select 0
_someguy = _this select 1
_teleportme setPos getPos _someguy
exit
I will get different results according to the parameters I put in. If I put in
[player, loon1] exec "teleport.sqs"
I will be teleported to the location of loon1. If I put in
[loon1, evilGuba] exec "teleport.sqs"
then loon1 will be teleported to the location of evilGuba. That's because _this means whatever the parameters passed to the script are. I don't need to have separate sections to define what happens to loon1, to the player, to evilGuba, etc., because they're all going to be processed through the same code. I "pass" different variables to the same code.
Similarly, you can have one section that says how to fire shells, and "pass" it different variables according to the parameters of the script.
Does it all make any more sense now?