stepper motor pograming

i am controling stepper motor through easy stepper motor driver & ardiuno.but i want pogram ardiuno such way that when ir sensore output detect it stop some time then stepper motor rotate and also stop on next ir sensore out put detect

So, what is the problem? Aside from the vague requirements, that is.

it stop some time

A random amount?

then stepper motor rotate

A random amount?