Trying to change servo sweep speed based on number of people in a room

I have tried to replace the delays with some form of millis but I do not currently understand how to implement it in a way to make the servo work.

It is just like an LED blinking, only instead to turning on and off an LED, each time slice you get you move the servo one small bit. To speed things up the number of milliseconds that must elapse between each entry of the state machine is changed.

Have you come across this http://www.thebox.myzen.co.uk/Tutorial/State_Machine.html
you might find it simpler to follow.