Just a note: you might get probs... As your variable names depend on nicknames. Nicks can change. You cannot be asure the right variables will unset.
Scenario:

Assume a user Joe!friend@somehost
* banning: *!friend@*
Now, you'll store a %bnickJoe *!friend@*
* Joe changes nick to Joe|away
* unbanning: *!friend@*

> Your script will try to unset %bnickJoe|away, as the user part of his addres is still "friend" but there is no such var.
> Same problem if Joe parts / quits / gets kicked: You will keep variables that are of no use any more.
To echo users affected by ban / unban, why do you need to set variables at all? Just loop the $ialchan and $ial to pick the names...