The way I would implement it would be, I would not prevent the player from leveling up (I don't believe I can), but what I would do is remove the player's available perk points to spend until they sleep in a bed. They would be available to spend for an in-game hour after sleeping, and then be removed again.
Should I move forward with this, or would this be a duplication of effort? Let me know. This would be a very easy mod to put together (like, an hour, tops), and would require SKSE.
The thread on http://www.gamesas.com/topic/1415232-relwiprealistic-room-rental/ got me thinking about this. Currently, other than the Well Rested bonus, most of the necessity of sleeping is not present in Skyrim like it is in Morrowind and Oblivion, and I'd like to bring that back again.