Identify local dynamics with URScript

Hi! I’m trying to excite the dynamics around the base and shoulder joints of my UR10.
This is the algorithm to be utilized for data generation:

qj0 = actual qj
Start data logging, t = 0s
while t < 8s do
dqj = random(-pi/18,pi/18) rad
v = random(0.5,2) rad/s
a = random(0.3,7) rad/s^2
movej(qj0+dqj,v,a)
Wait random(0.1,1.0) s
end while
Stop data logging

How can I translate this algorithm to URScript, please?

Thank you!