In the cases when you actually get stuck are you using the teleport with it failing close together. It could be that the delay needs to be fixed to ensure that the teleport check is ready to run again.

---------- Post added at 02:12 PM ---------- Previous post was at 01:58 PM ----------

Ok I figured it out and I had removed some redundant code that was not redundant. I can now test with improving the teleport accuracy from there