Update: Changed quite a few things around. Took Jethro_'s set -e suggestion, and also the $event suggestion.
Did a half-rewrite of the core, now relies on $ticks to try providing more accuracy. It grabs its needed $ticks values where necessary as soon as possible to minimize "latency" on the reported value.
Ran some tests using a dummy nick doing an /timer -h 0 (X) msg $active Test, etc, seems to hold a good amount of accuracy. Have not yet tested resilience to flood.