You can use if ($nick($chan,nick,!)) { and if ($nick($chan,nick,~)) { to test if a nick has such prefix mode.
mIRC has support for (at least) owner mode from unrealircd (+q mode), if that's your case (but you could try otherwise) you can use the isowner operator.
However there's no support for 'admin' (+a mode), so you would have to use $nick() there.