Why are you using Apps Script when you have the new Google Sheets component with a block to add a new row?
You could use a Clock component to format the current time according with Experiments with Logging DateTimes to Google Sheets
Regarding the need to remember where to post a TIMEOUT scan timestamp in the same row as the last TIME IN scan for that scanned number, I suggest using a TinyDB NameSpace to hold the row number value of the last TIME IN scan for that tag.
The AI2 Sheets Add Row block returns that row number, so that is a good event to catch it for storage in TinyDB.