The evennia recommended way of doing this is to consider this a new 'state'. That is - you assign a new SleepCmdSet on the sleeping player with two commands - one is the 'wake' command that brings you out of the state and the other is a systemcommand (CMD_NOMATCH) that catches everything else and gives the "you can'd do that while sleeping" error. When they do wake up, just remove that cmdset and all your normal commands are back - no need for any flags or if statements in normal commands.
To mute input, it's easiest to override the `at_msg_receive` on the Character's typeclass as Kovitikus already mentioned. All you need in it is
def at_msg_receive(self, msg, **kwargs):
return self.db.is_awake
If this method returns False, the message never reaches the player, which is what you want.
.
Griatch