Questions & Answers about Мне не спится, и я тихо выхожу в коридор.
Because мне не спится is an impersonal construction: it doesn’t describe an action you actively do; it describes a state that is happening to you. Russian often uses the dative like this to mean “for me / to me” in the sense of “I’m in a condition where…”.
So мне не спится is closer to “I can’t get to sleep / I’m unable to sleep” than a simple “I’m not sleeping.”
- мне не спится = I can’t sleep / I can’t fall asleep / sleep isn’t coming (involuntary, “it’s not happening”)
- я не сплю = I’m not asleep / I’m staying awake / I’m not sleeping (right now) (more neutral, can be voluntary)
The -ся form here often adds that sense of something occurring (or not occurring) on its own, not fully under your control.