Wait a second there is no $messagearea in the template you're trying to replace it in.
You want something like this...
Code:
$vbulletin->templatecache['newthread'] = str_replace('{vb:raw messagearea}', '<div class="blockrow">' . $test . '</div>' . '{vb:raw messagearea}', $vbulletin->templatecache['newthread']);
And it should be used in the process_templates_complete hook.