Just to keep things interesting and close my final open question, the solution that implements the below functionality in a nicely organized manner with a decent architectur
I would either turn it in to a jQuery plugin or a static object.
The static object just acts as a kind or wrapper. I would also break it up in to smaller functions e.g.
init()
checkLength()
checkTime()
So you might end up with something like:
Widget = {
init:function(){//setup events etc},
checkLength:function(){},
checkTime:function(){},
doMessage:function(){}
}