Is it possible to set the inactivity interval more precisely than in hours?
Yes; however, it requires a bigger change in the code. Current time can be determined with the os.date() or os.time function. The conditions would need to be modified, too.