Arduino Millis and Indexing Code

I like the idea you have presented here but I am still a bit confused how to code this.