You can add an instance variable "sequence" to your squares, and when they are flashing, set sequence to 1, 2, 3.. etc.
When user clicks the squares, make a variable clickCounter, increase it with every click on the squares. Compare clickCounter with square.sequence and if they don't match, it means that the user made a mistake.
Or you can do this with two string variables.
When squares flashing, set string1 to (string1 & square.UID & ",")
When player clicking the squares, set string2 to (string2 & square.UID & ",")
Then compare if left(string1, len(string2))=string2
if not, user has made a mistake.