There is no way to implement timers in LUA directly. Mosaic utilizes the string, math, i/o and bitwise LUA libraries....no access to the OS LUA library. If you need to interact with a timer within your script you can either enqueue a dummy timeline or download one of the wait or watchdog timer modules. When the timer trigger fires you can run a script to call function within your main script.
A good practice is to create a startup trigger and add your mainscript as the action. This way you can load all of your main functions and initialize variables on boot. All functions loaded on startup can be globally accessed from other helper scripts.