You could do that. If it's just a probability of happening or not you could just compare with one value.
aka random(100)<40 for a 40% chance.
If you want a probability of more than two things happening you would store random(100) in a variable first. So for example you want A to have a 30% chance and B a 10% you could do:
global number rand=0
every tick
--- set rand to random(100)
rand is between 0 and 30
--- do B
rand is between 30 and 40
--- do B