Well, glad it's working.
It could have simply been that the iMac USB ports reset during the time driving back and forth, although that usually worked for FireWire, not USB. That is effectively an SMC reset.
You stated you unplugged everything - including every single cable connect to the iMac, and left it that way for more than 5 mins?
If you find out anything, or I think of any other cause, we should post here for future reference.
Go enjoy the working peripherals,
C