Just seems like a issue in the script tbh... that code you show won't be enough to have a flawless script.
You should also check for the npc health and stuff, add some conditonal sleeps, etc
Feel free to post your code, so we can help you out
Khal Thieving (All in One) updated to V1.23:
- Added Vyre Vallessia von Pitt with banking in the minigame
- Added Gem bad support for thieving npcs (Just start with the bag in your inventory)
- Improved banking logic for npcs that give multiple items
Will be live soon
Enjoy!