It doesn't work because you can't have random variables outside of functions in a class. The way to do it would be to modify the loop in qa_list instead. This should work:
function q_list($q_list)
{
if (isset($q_list['qs'])) {
$this->output('<DIV CLASS="qa-q-list">', '');
$count=0;
foreach ($q_list['qs'] as $q_item) {
$this->q_list_item($q_item);
if ($count%3 == 0) {
$this->output('Hi this is the 3rd div');
}
$count++;
}
$this->output('</DIV> <!-- END qa-q-list -->', '');
}
}