I don't know if you've solved it already, but you should generate the random number before changing the state to the state that is using the random number. I'd recommend an ENTERING-state or similar, which is only used once per launch. Let me exemplify:
firstState:
if (something)
{
randomNumber = Math.random();
block.setState(seconState);
}
break;
secondState:
if (randomNumber > 0.9)
{
something...
}
break;
This will only generate one random number per launch and can be used to randomize events, such as roll backs.
I hope it helped!