1. Transient on the power that supplies the IR emitter. You said you had tried isolating the power to the emitter - what do you mean by this? Do you mean you tried driving it from a separate battery or wall wart?
4. A transient in the ground wiring or power supply to the Arduino causing the Arduino to malfunction. However, you said that it can't be resetting. Have you checked that nothing observable happens if you press the reset button? Even if your code does nothing, output pins become floating after a reset until the pinMode call is made, also internal pullups get disabled until they are enabled again. Either of these could cause something to happen.
I tried disconnecting the ground between the 24v power supply and the rest of the circuit, as Riddick suggested, and the problem did NOT occur when starting the motor manually.
maybe the cables between the arduino and the sensor act as an antenna?what if u use really short cables?or what if u put those cables far away from the motor?