Sending all your workers to try to kill a scout; even if it's already in your mineral line, will probably put you down more than the 50 minerals your opponent lost, as that could be 5+ seconds times 10-15 workers. At 43 minerals/worker/minute, that's barely break even, plus you might be losing the opportunity cost of spending your APM elsewhere.
CC/Hatchery/Nexus is building 100 seconds. After that each 25 seconds you will build 1 more SCV/drone/probe (don't consider chrono boost for now: you won't be able to use it from new nexus right after start). If I not wrong each harvester on non-saturated base give 47 minerals per minute...
I will do math for CommandCenter:
400+X*50 (expenses to build new CC + workers there) <= (Y/2+X)47(t-100)/60 (income of new base)
t=100+x*25
X - amount of SCVs produced by new CC;
Y - amount of SCVs brought from 1st CC to the expansion (I've split Y by 2 because those SCVs could bring some minerals on the main base, but smaller amount due to main base saturation. So I assume that on new base they will work twice more efficient).
Math could be complicated, because X SCVs don't start work immediately. To compensate that I will add a factor 0.5 to the X:
400+X*50 <= (Y/2+X/2)47(t-100)/60
also, lets assume Y=6 (we move 6 workers from main to expo):
400+50x <= (3+x/2)*19.58*x
9.79x^2+8.74x-400>=0
x1=-6.79, x2=6
x=x2=6, t = 100+25*6 = 250 => 4 minutes 10 seconds.
So, if you bring 6 SCVs from main and keep constantly building SCVs on new base in 4 minutes, 10 seconds you will build 6 more new SCVs and will compensate ALL expenses.
Is the math is correct you could extrapolate that to case when you build OC, Hatchery, use Chrono boost, etc...
Though that is a theory it give you some understanding of the process. If you want to know the time, when opponent is biggest investment (time when he invested a lot CC + 1st SCV + 2nd SCV, but didn't receive feedback at all), you could take derivation of suggested formula...
Best Answer
You will need to read up on Units (anything you can click on). Each unit has an ID.
Next, you will have to use a trigger. When a harvester starts to harvest from a mineral patch, you will make a trigger that assigns that harvester to the mineral patch.
You can learn the basics of triggers here.
So once a probe starts harvesting, you can trigger a countdown or whatever you have in mind. Then in that trigger you will command it to go back to the ID it just harvested from which can be found from the resources it is currently gathering or the X/Y axis on the map (I'm also assuming there are other ways to get the ID of what it came from)