Check this out:
arduino.out(4).blink(100).doFor(hours(1))
Blinks a pin every 100 milliseconds for an hour. And once you execute another statement, that blinking pauses until the next command is done.
arduino.out(4).analog(127).doFor(minutes(10))
After 10 minutes, the pin goes back to the original blink routine.