He's only checking within 1 deviation - if he wants to generate a curve that's actually close to gaussian, he'll need to check 3, or else he'll just have the 68%. See the example that he posted above.
Computationally, it's not worth dealing with values that have the potential to be incredibly outlandish (i.e. 5000, when you're looking for a value from 4000-4500). the chances of such a value occurring are incredibly small, but regardless, you only have to check one or two boolean statements, so it's worth it to just make the check.
It does do that by itself, that's its purpose, but you're only checking 1 deviation in your loop:
}while(dynamicReturn < (mean-deviation) || dynamicReturn > (mean+deviation));
You'll want to make that 3*deviation in both cases.