The script does not use either the left or the right mouse button. It uses the USE (default = F) button to plant. I do not see the sense in switching to the ADS button (= right mouse button) in order to plant a mine, when the F button at that point is free.
Also, 10 mines? What the hell is that for? Are 2 not enough?