I'm a "programmer" myself (I follow programming in college 2nd year now), i understand how fixing things like that aren't easy at all, just wanted to let you know and good luck with it
The only improvement i can think off with the miner script is when the ore is mined from someone else and you're mining the same ore it waits to click on a new ore until your own character is finished with the ore eventho its already mined.