Here's a timed resting script that even works with new-years rollovers... Assuming I have the undocumented bioware time functions figured correctly

void main()
{
if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
int nRestHours = 2;

object oPC = GetLastPCRested();
int nLastRest = GetLocalInt(oPC, "LastRest");

int nCurrentMonth = GetCalendarMonth();
int nCurrentHour = GetTimeHour() + ((GetCalendarDay()-1)*24) + (GetCalendarYear() * 8760);

if( nCurrentMonth > 1 ) nCurrentHour += (30*24);
if( nCurrentMonth > 2 ) nCurrentHour += (28*24);
if( nCurrentMonth > 3 ) nCurrentHour += (31*24);
if( nCurrentMonth > 4 ) nCurrentHour += (30*24);
if( nCurrentMonth > 5 ) nCurrentHour += (31*24);
if( nCurrentMonth > 6 ) nCurrentHour += (31*24);
if( nCurrentMonth > 7 ) nCurrentHour += (30*24);
if( nCurrentMonth > 8 ) nCurrentHour += (31*24);
if( nCurrentMonth > 9 ) nCurrentHour += (30*24);
if( nCurrentMonth > 10 ) nCurrentHour += (31*24);
if( nCurrentMonth > 11 ) nCurrentHour += (30*24);
if( nCurrentMonth > 12 ) nCurrentHour += (31*24);

if( (nCurrentHour - nLastRest) < (nRestHours) )
{
AssignCommand(oPC, ClearAllActions());

int nTimeLeft = nRestHours-( nCurrentHour - nLastRest );
string sTimeLeft = IntToString( nTimeLeft );

string Units;

if( nTimeLeft == 1 )
{
Units = "game hour";
}
else
{
Units = "game hours";
}

AssignCommand( oPC, ActionSpeakString( "I'm not really sleepy... Maybe in "+sTimeLeft+" "+Units+"... nCurrentHour:"+IntToString( nCurrentHour )+" nLastRest:"+IntToString( nLastRest )+" RestHours:"+IntToString( nRestHours ) ) );
}
else SetLocalInt(oPC, "LastRest", nCurrentHour);
}
}