A poor solution is to counter-act the scripted raise of the target in applying a "hit" EH and then manage the sequence:
in init field of target(s):
this setVariable ["nopop",true,true];
this animate ["terc",1];
this setVariable ["nopop",true,true];
this addEventHandler ["hitpart", {
_this spawn {
waituntil {(_this select 0 select 0) animationPhase "terc" ==1};
waituntil {(_this select 0 select 0) animationPhase "terc" <1};
(_this select 0 select 0) animate ["terc",1];
}}];
0 = this spawn {
while {true} do {
waitUntil {_this animationPhase "terc" >0.5};
sleep (4 + random 4);
_this animate ["terc",0];
waitUntil {_this animationPhase "terc" <0.5};
sleep (1 + random 1);
_this animate ["terc",1];
};
};
Note: The Arma's script targetP_Inf_F_Hitparts.sqf fails as the following loop is breaking (after 10000 iterations?):
scopeName "root";
....
if (!isNil "nopop") then
{
if (nopop) then
{
breakTo "root";
};
};
anyway, you could modify the last part of your script, to read:
if (!isNil "nopop") exitwith
{
if !(nopop) then {_target animate ["Terc", 0]};
};
_target animate ["Terc", 0]