Here is my script so far. What happens is the soldiers are created only once and after you shoot one, they do not come back. Also, it only makes ai for one squad, instead of moving on to the next squad.
;["Soldiertype" (0),unit skill (1),number of guys per group (2),group target (3),respawn point (4),[group1,group2,etc.] (5)] exec "respawn.sqs"
_unittype = _this select 0
_unitskill = _this select 1
_unitnumber = _this select 2
_target = _this select 3
_respawn = _this select 4
_groups = _this select 5
_count = 0
_groupcount = 0
#create
_unittype createunit [(getpos _respawn),(_groups select _count),"",_unitskill,"PRIVATE"]
_groupcount = count units (_groups select _count)
leader (_groups select _count) move getpos _target
#check
~.5
?_groupcount != _unitnumber: goto "create"
?_groupcount == _unitnumber: goto "switchgroups"
?_count > count _groups: _count = 0
goto "check"
#swtichgroups
_count = _count + 1
_groupcount = count units (_groups select _count)
goto "check"
What I'm trying to make it do is first, create a squad for the first group. Then create a squad for the second group. It then constantly switches between the two groups to make sure they are at full strength and if they aren't, it tops them up. It is a very simple script but it will do just fine for what I have planned. The syntax is at the top.