If you're getting a banmask, then as long as the address is in your IAL, you can find it like:

$ialchan($banmask,$chan,1).nick = 1st matching nick
$ialchan($banmask,$chan,0) = total count of matching nicks

Note that by default the IAL contains only nicks that have done something, such as join or msg the channel, or if you have whois'ed them. So this can exclude all the nicks who are already in the channel when you join it.

If $ialchan($banmask,$chan,0) is not the same number as $nick($chan,0) then you can "/who $chan" to have the server send you all the addresses in the channel. You can also do this as you join the channel, but this risks you being disconnected for flooding if you do this in several huge channels at the same time. You can spread out these commands using a timer with varying delay, like

on me:*:join:#: { timer 1 $calc( ($chan(0) -1) * 10) who $chan }

All the usual warnings apply, you probably want to exclude ops and/or yourself, and you may not want to take action if it matches everyone or most.

If you checkbox options/irc/flood/op-commands it will queue your mode/kick commands to keep you from being flooded due to sending too many too fast.