Your spaces and braces are all messed up. Use the mIRC editor and you'll see that things don't align properly.
This is the correct way to use multiline if blocks:
if (%randnumber == 1) {
cmd
cmd
}
elseif (%randnumber == 2) {
cmd
cmd
}
else {
cmd
}
Please surround your code with [code][ /code] to place it into a code block (remove the space).