Arduino randomly freezes during runtime?
You should replace:

if(currentTime - previousTime == delayTime){


with

if(currentTime - previousTime &gt;= delayTime){


There is always a chance that, since you are using a servo which is quite intensive with interrupts, that millis() may skip a beat and that statement can never be true.