Motorola Milestone problems
I have encountered random OFF problem a couple of times and it seemed to be always related to the connection with a Bluetooth equipment. For the random ON problem I would recommend shutting down the sound and keeping the device ON every time. The random music activation should have been corrected with the latest firmware update. In my case, the firmware version 2.1-update1 corrected the random music activation. I would recommend that you make sure all your firmware updates have been done.

These are not the best solutions but that is all I have been able to find. Let's hope the next update to Android 2.2 will correct all these issues once and for all.