Ah, if wolfrugs works then do that its much simpler. but in case you were curious, the way i do animation loops is like this...
Basically an animation loop looks like this (in sqs because i think sqs is easier to learn because it is cleaner looking)
_unit = _this select 0
_tgt = _this select 1
? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) > 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1)))
? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) < 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1))) + 180
? _Ang < 0: _Ang = _Ang + 360
#loop
? (_unit distance _tgt)<5:exit
_unit setdir _ang
_unit switchmove"animationname"
~2
goto "loop"
The first line is the unit that will be moving
the second line is the place you want the unit to move to
the next few lines is a mathematical calculation to find the direction the unit should go to get to the target
the 6th line where it says #loop means start of a loop which in sqs scripting is well... like a loop
the next line checks if the unit has arrived at the place, and if so it exits the script, if it is not then it ignores the part after the : and moves on to the next line.
in the next line we set the units direction as _ang which is a number value that was computed earlier to make the unit face the target. After that is the command that makes the unit play the animation, and finally a 2 second wait and then the loop starts over again by going back to #loop
the number after the ~ is the number of seconds it will wait, it is different for each animation, you will need to get it to be right at the point the animation is finished and the cycle should begin again, *this often is before the actual end of the animation*
some times you will need to further control the unit with a setpos inside the loop
tell me if you understand then we'll see if we can modify it for your situation.