well.... all u have to do is to use "foreach u [chanlist #channel]" to find all the nicks in the channel, then use "rand" to pick one of them. after that u just have to activate a utimer which will be canceled if the nick responds in time... 30 secs
set nicks [lrange [chanlist #chan] 1 end]
set len [llength $nicks]
set randnick [lindex $nicks [rand $len]]
This assumes that the bot's nick is the first in the list. I don't think that's a documented feature but it generally works out.
Now to do your second part, giving him 30 seconds to say something, you have to use a pubm bind and a utimer. Check tcl-commands.doc for more information. If you want t ocatch actions too (like /me says hi), then use a ctcp bind.