Random movement and automatic pause

IN POSITION

 

moveMin = .3; //minimum move time
moveMax = 2; //maximum move time

pauseMin = .3; // minimum pause time
pauseMax = 1; // maximum pause time

minVal = [0.1*thisComp.width, 0.1*thisComp.height];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height];

seedRandom(index,true); // set pre-run for endT
endT = – random(moveMax);

j = 0;
k = 0;
while ( time >= endT){
j += 1;
seedRandom(j,true);
startT = endT;
if (j%2){
endT += random(moveMin,moveMax);
k++;
}else{
endT += random(pauseMin,pauseMax);
}
}
if (j%2){
seedRandom(k,true);
endVal = random(minVal,maxVal);
seedRandom(k-1,true);
startVal = random(minVal,maxVal);
ease(time,startT,endT,startVal,endVal)
}else{
seedRandom(k,true);
random(minVal,maxVal)
}