First off, I wouldn't have this as an on connect event, since there's no guarantee that you're going to be in a channel for the message to be sent to via the timer. I changed it to an on join event, and did a bit of re-writing, coming up with
on me:*:join:#:{
if !$timer(end) {
.timerend 4:00 1 1 timermsg off
}
if ($asctime(HH:nn) < 19:34) && ($v1 > 04:00) && !$timer(start) {
.timerstart 19:34 1 1 msg $chan
}
else {
msg $chan
}
}
alias msg {
.timermsg 0 10 msg $1 hello
}
on *:disconnect:{
.timermsg off
.timerstart off
.timerend off
}
Please note that you can't have a script that literally "never missing a heartbeat", since the script won't work if you're disconnected.
However, aside from the condition that you must be connected, I think the above script will work per your request.