Hey Tomby, here's a script that has a more proper syntax than my tutorial and uses distance to check before deleting. Use if you want...
;-----------------------------------------------------------------
;execute script as [position-to-create,groupname] exec "script.sqs"
;-----------------------------------------------------------------
#START
_pos = _this select 0
_grp = _this select 1
_units = units _grp
_leader = leader _grp
;-----------------------------------------------------------------
#LOOP
? !(alive player): exit
?(("Alive _x" count _units) < 3): goto "KILL"
?!(canmove _tank1): goto "KILL"
?!(canfire _tank1): goto "KILL"
~(random 5) + 5
goto "LOOP"
;----------------------------------------------------------------
#KILL
_tank1 setdammage 1
;wait for tanky to stop smokin
~(random 10) + 60
;----------------------------------------------------------------
;check if player is close by
#WAIT
?(player distance _leader > 100): goto "DELETE"
~(random 5)
goto "WAIT"
;----------------------------------------------------------------
#DELETE
"deletevehicle _x" foreach _units
~1
deletevehicle _tank1
~(random 10) + 10
;----------------------------------------------------------------
;create new tank with crew
_tank1 = "BMP" createvehicle getpos _pos
~2
"SoldierECrew" createunit [getpos _pos, _grp,"c1=this",1,"SERGEANT"]
"SoldierECrew" createunit [getpos _pos, _grp,"c2=this",1,"CORPORAL"]
"SoldierECrew" createunit [getpos _pos, _grp,"c3=this",1,"PRIVATE"]
~1
c1 moveincommander _tank1
c2 moveingunner _tank1
c3 moveindriver _tank1
~(random 10) + 5
goto "START"