So if I understand you correctly, your condition always evaluates to true when a guest is viewing it? Thus the class "shown" is always added?
Is the $post variable available in the template? Also, try putting the following in your template before the div that contains the if condition so you can see what it outputs:
HTML Code:
{vb:raw post.userid} -> {vb:raw bbuserinfo.userid}