Check out Math.random() and setInterval(), that's all you
need. With setInterval, you can call a function repeatedly, so
you'll need a function that changes the rectangle. e.g.:
rect._height = Math.random()*200;
Because Math.random() returns a random number between 0 and
1, it has to be multiplied by 200 to return numbers between 0 and
200. Check the Help, there's another (better) example for random
numbers in certain intervals.
Then you just have to set the interval to call this function
in the frequency you wish:
var intervalID = setInterval(changeRect, 500, rect_instance);
500 ms = half a second, rect_instance = the instance of the
rectangle. If that is always the same instance, you can also avoid
this parameter and put the name in the changeRect function.
To stop the interval, use