I didn't know there was a time required. Just sleep of any duration.
Do you want to establish a minimum? And how? Just not allow sleeping for less, or the more complex (impossible?) suppressing the level-up?
I think the former could be accomplished by having a menumode script choose the cancel option for you if the duration isn't enough. I'm not sure if a script could reduce the skill levels below the threshhold and re-raise them after the sleep to do the suppression.