Hello,
We recommend you to check the included example in the folder Templates/removeTemplateVariable.
When you write the placeholder you don't write the symbols that wrap the placeholders. You need to remove placeholder using this line:
$docx->removeTemplateVariable('OTHERVAR', 'block');
and not:
$docx->removeTemplateVariable('$OTHERVAR$', 'block');
Also please check that your script is running correctly and doesn't have any error; maybe this is not correct and the removeTemplateVariable method is not being called:
if(strlen($varValue) == 0)
Regards.