How to add classes to comments?
I think your ternary statement is off in that code.

I would also suggest an alternative approach.  You can use hook_preprocess_comment() in a template.php file or in a custom module.  With this you can hook into the comment before it's rendered to the page, run each comment through an logic test and add a class to the entire comment, or add an html chunk before or after the comment's html.  See more on hook_preprocess and render arrays.