Switch template in extension
I use alter template file in 4.7.2. It has been working great for me.

I needed to switch out the contact editor form based on contact subtype. One important thing I found if doing this programically was the clear the template cache. 

function customcomponent_civicrm_alterTemplateFile($formName, &amp;$form, $context, &amp;$tplName) {

    // swith contact template based on contact type
    switch ($formName) {
        case 'CRM_Contact_Form_Contact':

            $clear = true;

            if ($form-&gt;_contactType!='Individual'||empty($form-&gt;_contactSubType)) break;

            // there are some weird non printable chars on contact sub type
            $contactSubType = preg_replace('/\W/i','',$form-&gt;_contactSubType);

            // switch out the form based on contact type
            $newTpl = 'CRM/Contact_'.$form-&gt;_contactSubType.'/Form/Contact.tpl';
            $newDir = __DIR__ .'/templatesconditional/ContactSubType_'.$contactSubType;

            break;
    }

    // clear out old templates -- found CRM_Admin_Form_Setting_UpdateConfigBackend::postProcess -&gt; CRM_Core_Config::cleanup
    if (!empty($clear)) {
        $config = CRM_Core_Config::singleton();
        CRM_Utils_File::cleanDir($config-&gt;templateCompileDir, false);
        CRM_Utils_File::createDir($config-&gt;templateCompileDir);
    }

    // switch out the templates
    $template = CRM_Core_Smarty::singleton();
    if (!empty($newTpl)&amp;&amp;$template-&gt;template_exists($newTpl)) $tplName = $newTpl;
    if (!empty($newDir)&amp;&amp;is_dir($newDir)) $template-&gt;addTemplateDir($newDir);
}