Please next time just put it in a paste bin like this https://pastebin.com/cwqfW560 so it's easier to read. Or use the code function built into OSBot's page
Also you can see if the mouse is teleporting or not if you go to Settings, Options, Debug, Then check mouse trail. It will put a red X where the mouse is. The interaction method should be moving the mouse and not teleporting it like a touch pad.
I didn't look through it much, like at all honestly.... But I would suggest making the script use one action per loop of the onloop. Like how Explv does in his tutorial here at 15. My guess of why it breaks is because of lag or something and it just collapses the whole script into like a NPE and stops it or something. Doing this would probably fix it or help at least.