I was wondering what this "Pause after playing" you mention was, but then I saw you meant the "Stop after playing" function.
This is what I would try, given the existing functionality in MC.
1. Set up a Smartlist that selects random "going to sleep" music, and limits the selection to a certain number of tracks, or a time limit.
2. Set up a command in the Resource.xml file to send the
MC Core Command 30007 "Play Playlist" to play the Smartlist.
2. Set up a button on a programmable remote control to send the command set up in step two.
Then if I was still awake when the music stopped playing, I would just press the remote button, the Smartlist contents should refresh, and another set of tracks would be played.
I haven't tested the above, and it depends on you having a programmable remote, but it should all work.
You could also use some scripting language to set the MC "Stop after playing" function and start playback.
Or maybe even use a voice control solution.
The best approach depends on how you interact with MC when in bed, and basically asleep.