The script I am working on doesn't work in an environment as chaotic as a looter in a spawn. I am just making sure that I keep an NPC vendor within reach whilst dropping things on him. My current code positions the toon and starts the process. It does a check between drops to confirm the NPC is still within two tiles, and pathfinds if the NPC moves outside that check. I had no wait in between the previous drop, the check, and the pathfind, if they were to all hit, and I think that was causing my occassional crashes. The cursor-check/item-drop snippet check you are suggesting is probably a good way to bullet-proof the routine -- but my instinct is that a wait 10 in there might be plenty stable.
However, it sounds like it should be possible to write a code snippet that confirms that you don't have anything on the cursor, and drops it (in your pack?) if you do, that would eliminate the crash issue in pretty much every potential application. Any of you experts care to hazard a slice at the sub that makes that check? While I am asking, is there a way to check if there is a booger on my cursor?