Handling Alarm reset

Hello, I have two tags: one is a query tag that returns up to one row using SELECT TOP 1, and the other one is an expression tag using the expression len({[.]ScaleBelowMinSpread.value}) = 0

basically checking to see if the first tag is empty. If it's not empty, I have an alarm pipeline to send out the results of the dataset in an email and then using Python scripting I update the table to reflect that an email has gone out.

This works fine when there's only one data entry to worry about, but it fails if there are any more, as the tag that checks to see if the dataset is empty stays flipped in the off position and never resets to look for any other ones. What is a good way of handling this edge case? I tried adding a line of code to forcibly flip the bit in the expression tag using writeBlocking() but it doesn't seem to work, or perhaps it doesn't take priority over the bound expression.

Alarm Active script under Alarm Events Scripting

def alarmActive(tag, tagPath, alarmName, alarmEvent, alarmPath, missedEvents):
    databaseConnection = "Scale"
    RecordID = system.tag.read("[.]ScaleBelowMinSpread[0,0]").value
    query = "UPDATE mySqlTable SET EmailSent = 1 WHERE EmailSent = 0 AND [ID] = ?"
    params = [RecordID]
    system.db.runPrepUpdate(query, params,databaseConnection)
    system.tag.writeBlocking(["[.]ScaleMinSpreadQueryIsEmpty"], [True]) --Line I added to forcibly flip bit

Custom Message under Email Notification Properties:

" ATTENTION: SPREAD FAILED MINIMUM REQUIREMENTS"+
"
Process: Line 1" +
"
Datetime: " + {[.]ScaleBelowMinSpread[0,1]} +
"
 Net1: " + {[.]ScaleBelowMinSpread[0,2]} +
"
 Net2:"  + {[.]ScaleBelowMinSpread[0,3]} +
"
 Net3: " + {[.]ScaleBelowMinSpread[0,4]}  +
"
 Net4: " + {[.]ScaleBelowMinSpread[0,5]} + "</html>"