Added ability to run Lua functions after a delay, or periodically