These might help you:
Using millis for timing
Demonstration for several things at the same time
Finite state machine tutorial