This code do validation user's permissions to comment:
$acl = & JCommentsFactory::getACL();
if ($acl->canComment()) {
// user can comment
} else {
// user can't comment
}
so we could use this function in our code:
<?php
$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$count = JComments::getCommentsCount($id, 'com_sobi2');
$link = JCommentsObjectHelper::getLink($id, 'com_sobi2');
$acl = & JCommentsFactory::getACL();
echo $count ? ('<a href="'.$link.'#comments">Comments('. $count . ')</a>') : ($acl->canComment() ? ('<a href="'.$link.'#addcomment">Add comment</a>') : ('<a href="'.JRoute::_('index.php?option=com_user&task=register').'">Please login to comment</a>'));
}
?>
It will display 'Comments(10)' if there are 10 comments and 'Add comment' if 0 comments and user has permissions to post new comment or 'Please login to comment' if he hasn't.
Also I can suggest you to setup appropriate messate in JComments settings - it will be displayed to users who has no permissions to post comments. Otherwise they would see nothing if there are no comments for certain item.