Repeat some actions (and waiting) in rule

See Design Pattern: Looping Timers which should get you started and provide the explanations for the following:

var maxLoops = 10
var Timer myTimer = null
myTimer = createTimer(now.plusSeconds(0), [ |
    Valve.sendCommand(if(Valve.state != ON) OFF else ON)
    maxLoops = maxLoops - 1
    if(maxLoops > 0) myTimer.reschedule(now.plusMinutes(1))
])

Usually myTimer would be declared as a global so you can cancel the loop from some other Rule if you need to. The first time the Timer is scheduled to run immediately. After maxLoops times the timer exits without being rescheduled.