I think that a single loop is sufficient. See if this works for you (may need a few tweaks. It both arrays transition at the same time, it will only count it if this happens at the second hall pulse, probably a reasonable choice, but modify as needed if you want something else.)
It will stop once the second hall pulse is received. No need to continue.
(The "to I32" is only needed if you expect more than ~32k pulses per revolution.)
You actually could take the orange comparison out of the loop.
To understand the code, here's a quick simulation, tapping and graphing some inner data. I am sure there are several other (potentially even simpler) ways to do about the same ... (there could even be bugs ;))