Code:
//var %random | while (!$gettok(botnick1 botnick2, %random , 32) ) { var %random $nick($chan,$rand(1,$nick($chan,0))) } | echo -a %random



Remember that when you exclude-then-repeat you need to make sure those are not the only nicks in channel, or you get infinite loop.