Replacing delay with milli

Thanks for the quick reply, but 'you need to rewrite the full thing' and 'google it' wasn't quite what I was after...
I have a vague understanding of state machine mechanics and I know why the 'delay' function doesn't work. But I'm still a bit of a novice with arduino coding I was maybe hoping someone might know a similar/ decent representation of a similar code or design that I could study and use to rewrite my code accordingly.
Ive only really dabbled in arduino coding and it's not a part of what I do day to day so I'm just self taught and struggle to find the time to do a lot of research into more complex techniques