Set the count much higher than 1000. It's a failsafe, even a rbpi will loop through 1000 very quickly.

Also, please only check if(NAVRESULT_NOP), then do the NOPcount check inside that if clause.