Set this variable to zero when ever any record selected
Very good idea.
Food for thought. It will obviously totally depend on the nature of your databases use, but for many I've written the end user would have a single record open for upwards of an hour and actually using it while doing other things.
That considered, you might also consider also adding that function to “On Edit” for each field of your form in order to keep the timer in check for real live activity and not just record selection.