There is no way your original code could be 5 instructions or less per loop. Each line of code will create at least 1 instruction. You have 4 lines inside the while, so at least 4 instructions plus two for the while (test and branch) will be executed each loop. For every if statement that is true you will get at least 1 additional instruction if not more.
So now you need to look at the old equipment and determine how fast you really need to detect changes. Is the original equipment running on a 1 MHz clock or is the output signal yopu want to monitor changing at a 1 MHz rate? If the signal you are looking at is changing at a 1 MHz rate, you will need a faster solution to detect it.
Bookmarks