I see the template is prodforums_product_details, so you'd have to find where render() is called for that template. It will be a section of code something like:
Code:
$templater = vB_Template::create('prodforums_product_details');
$templater->register('my_var', $my_var);
/// etc, etc
$templater->render();
So probably $product is set to something somwhere around there, and your code would have to be after that. If it's completely custom code it's possible there is no hook, in which case you might have to edit the code.