It is better to write one script to handle a generic plane, group and spawn marker, and then call it for each group.
spawninheli.sqs
;[heli,group,spawnmarker] exec "spawninheli.sqs"
if (not local server) then {exit}
_heli = _this select 0
_grp = _this select 1
_spawnmarker = _this select 2
#loop
if Stopspawn or (not alive _heli) then {exit}
if ({alive _x} count units _grp < 1) then {goto "spawn"}
~30
goto "loop"
#spawn
"OfficerW" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
"SoldierWMG" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
"SoldierWB" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
"SoldierWB" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
"SoldierWB" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
"SoldierWB" createUnit [getmarkerpos _spawnmarker, _grp]
~.2
{_x MoveinCargo _heli} foreach units _grp
~30
goto "loop"
Call this script for each attack group i.e.
[chinook1,attackgroup1,"spawn1"] exec "spawninheli.sqs"
[chinook1,attackgroup2,"spawn1"] exec "spawninheli.sqs"
[chinook2,attackgroup3,"spawn2"] exec "spawninheli.sqs"
[chinook2,attackgroup4,"spawn2"] exec "spawninheli.sqs"
[chinook3,attackgroup5,"spawn3"] exec "spawninheli.sqs"
[chinook3,attackgroup6,"spawn3"] exec "spawninheli.sqs"
The line if (not local server) then {exit} can be removed if this mission is not for MP. If the mission is for MP you must also put a game logic named server on your map for the script to work properly.