Just tested and confirmed it seems to be working fine. It deposited the inventory, withdrew the bag, emptied it into bank and continued. Are you running mirror mode or the normal client? Before re-running the script close the client and start a new one. If the bug occurs again please post a copy of the logger.
I tested this just now as well and didn't seem to have any issues. The only time the script should be teleporting away is if it's at or under the desired eat hp with no food, the inventory is full and doesn't have any food in it or a skulled pker is nearby. The looting method does nothing with the looting bag besides making sure it is open prior to looting. I'll ask the same things I asked the other user. - Are you running mirror mode or the normal client? Before re-running the script close the client and start a new one. If the bug occurs again please post a copy of the logger.
The biggest thing is posting a copy of the logger, this will narrow it down to what portions of code are running when the error occurs and should make it fairly straight forward to figure out what's happening. That being said, if you guys are having these bugs when running mirror mode there may not be much I can do about that.