Since guest have also usergroup 8 (which is strange I guess) you may something like this in your plugin:
Code:
$hook_query_where .= " AND (usergroupid != 8 OR posts=0)";
This filters banned users but skips guests (which have 0 posts). Since you often ban users which have posted something improper. This is a crude workaround, but nothing better has come to mind yet.