For starters, yuck! LOL.
Are you using all that UOAKey logic? There's a lot more going on there than what really needs to be.
What is the "FindUsableMiningTool" sub? That seems to be missing in your post, or I'm blind which is also likely.
<update>
I'm curious why " Gosub waitForSysVar contSize <> 530_497 30" is in the ClickTinkerButton sub before " Gosub waitForSysVar contSize = 530_497 30", seems like that's a bit of a waste of time every time. Also, I don't see %return getting set anywhere so all of the "If %return" statements are unnecessary.
Another oddity is that it doesn't look like the script will ever close the tinker gump unless it successfully makes a shovel.
THEN there's this gem -
GoSub ClickTinkerButton 380 290
If %Return
{
GoSub ClickTinkerButtonNext
GoSub ClickTinkerButton 380 290
}
So first, it clicks the Next button (380 290) then it calls the ClickTinkerButtonNext sub which does EXACTLY the same thing only to then click 380 290 yet again LOL.
This thing is a bit of a mess, honestly I think the real question is why does this work at all

Still haven't nailed why it keeps making tinker tools over and over though, been having fun poking at it with my smelting stick (yes this is a Harry Potter reference).
XII