This is a rough thought, but I wanted to give you some ideas. I'm typing this half-awake, pardon me if it doesn't make sense.
Give the box a variable, say, SequenceNumber. The first box you are supposed to touch would have a value of one, the second, two, etc.
The player could have a variable called CurrentSequence, set to 1.
Give the player another variable, CorrectGuesses, set to 0.
Give the door a variable called LevelGuessTotal and set it to n (n being the number of boxes you have to hit, 7 in your example).
Player hits correct box
Player collides with box (or presses button while overlapping box)
+
Box.SequenceNumber = Player.CurrentSequence
-> Player.CorrectGuesses + 1
-> Player.CurrentSequence + 1
Player hits incorrect box
Player collides with box (or presses button while overlapping box)
+
Box.SequenceNumber != Player.CurrentSequence
-> Player.CorrectGuesses - 1
-> Player.CurrentSequence + 1
Activate Door
Player collides with box or presses button while overlapping box)
+
Player.CorrectGuesses = Door.LevelGuessTotal
-> Open Door
else
Door doesn't open
This looks like it can work. Looks good thanks, but I'm now changing it up a little.