$address looks up the nick in the $ial, and then applies the $mask function to it.

$mask($ial($nick),2) would return *!*@host for example.
$address($nick,2) does the same thing but is easier.
$ial($nick) and $address($nick,5) are the same thing smile

and as for the script not working.. :-\ it should but like I said, I didn't test it so.. oh well.