How many devices do you have plugged into the USB ports on your Mac?
Is this a mighty mouse or an aftermarket unit?
Let us know
This may sound strange, However could you unplug the external drive and try putting the machine to sleep and let me know what happens.
just let me know how you get on and if that mkes any difference or not.
Glad to hear that it worked.
By the sounds of thing your external drive is locking up the USB hub on your imac as it may be drawing too much power.
You may wish to consider a powered USB hub that you can hook to your iMac and then plug your external drive into it and leave the mouse connected to the iMac directly.
Let me know if you need more help or info.