I believe the DocumentContext's PageTemplate may not be available on the Form Tab, since a form tab's editing page doesn't have a template.
You have the right idea to use a macro to modify the Visibility condition, but you may need to do a lookup manually.
Documents[DocumentContext.NodeAliasPath].DocumentPageTemplate.CodeName
You'll have to see how you can get the NodeAliasPath, it may exist in the DocumentContext while the PageTemplate may not, otherwise you may need to create a custom macro that takes some Page identification (DocumentID perhaps) which is available and gets the value for you.