One way I can think of is having an invisible sprite that each object will pass on each rotation. Then when you create your objects, they have instance variable like rotationTime. Give it a random number after you create the object int(random(2,6)).
Then each time the object collides with the invisible sprite first subtract 1 from rotationTime. Then check to see if it's 0, if it is, reverse the rotation and give rotationTime a new random number.