Ahh that would make sense.
Try this, in the dropnstock sub you're going to see the following section:
;Deal with ghost items in pack by re-opening
wait %lWait
event macro 8 7
gosub XIIxGumpWait container_gump container_gump 230_204
The %lwait is set to 20 (1 second) at the top of the script however it is also used in a few other places. What you could do is simply replace the %lwait with a larger value and test it out again. Start with 60 and if that works simply lower the number until you get to a value just slow enough so that you don't have the issue anymore:
;Deal with ghost items in pack by re-opening
wait 60
event macro 8 7
gosub XIIxGumpWait container_gump container_gump 230_204
If you change it to 60 and it still has the issue then you know it's not the problem because 3 seconds (60) should be plenty of time for it to try opening the pack after opening the secure.
Let me know how that goes.
X
OK. After looking back over the last few dozen posts I have not found my "exact" problem. What I have happening is after using up all of a tool(shovel) I am getting a ghost of the tool with 1 use left in my backpack.
The script refuses to move on to the next tool until that one is "destroyed/used up". I can fix the problem by simply moving the "ghosted" shovel. This does not, however, stop it from happening again later.
I will try changing some of the timers as the post above states and see if that helps. I am not worried about saving any time on the script since I let it run at night when I am asleep or away from the computer for any length of time greater than 30 min.
Other than the ghosting issue I have not seen any issues. Although I think that I am going to need to turn off blackrock collecting since there is very little need and I picked up nearly 100 in one night.

Update: For whatever reason it is not pulling iron ingots from secure. It pulls a stack of 20 gold ingots instead and it is still trying to tinker with the iron and not the gold. Never noticed before because I never ran out of pre-made shovels in secure and the 300 ingot pile I left on him.