<05.07 19:58:43> <gather-lv> [19:58] #janis# bans
<05.07 19:58:43> <gather-lv> Global bans:
<05.07 19:58:43> <gather-lv> Channel bans for #Botnet: (* = not placed by bot)
<05.07 19:58:43> <gather-lv> (There are no bans, permanent or otherwise.)
<05.07 19:58:43> <gather-lv> Use '.bans all' to see the total list.
You've got a few excessive } in there...
Also, drop the foreach-loop as you're using newban rather than newchanban.
The reason why the earlier versions gave you trouble, is most likely due to that the channel member list was not ready when the pv_kick2 proc got called, and hence the onchan-test would fail (and the isop/isvoice would always be true).