Couple thoughts:
The less functions in the start/aloop section the better, but sometimes another function or find/extract is needed to ensure withstanding minor site changes.
I like to aim towards as much pre-processing (prior to 'start') that can be done to manipulate the data so that once its split, there are less (or none) false results in the array.
using IF and a 'loop' will not create an infinite loop since all its doing is increasing the result array index and going back to 'start'. So it's OK to use that for detecting an anomaly and making the script work.
Let the Bit Che handle any removing of results related to dead/seeders, unless you have really good reason to do so from the script.
Above all, if it works and its not visibly slow, and you have tried to optimize it, then it works
Check out the script for TPB where it can use .torrent if available, http or HTTPS depending on what the user has selected for the mirror or also fall back to the magnet links. Its not pretty, but it works.
Oh lastly, problems with login sites might be with the failed failed2 where the first should be if you are not logged in and the second is if you are logged in but need to relogin. I usually request the final search page from another browser that wasn't logged in to see that scenerio. Could also be something else like the site is checking a referrer header tag which might need some tweaking.