Interference problem with slotted IR sensors

mikeoz:
I've already put a 0.1uf ceramic capacitor across the gearmotor terminals.

Those type/size should do. Ceramic is best for this kind of filtering.

If your motor has a metal case, try also adding caps between the terminals and the case for additional filtering.