Hi Dave,
First of all, congratuations on finding the correct template to customize. The autoidx templates are the most complicated in DocBook XSL, IMHO.
The templates in autoidx.xsl make use of some entity references such as "&primary;" to keep the code readable. The entities are declared in common/entities.ent. If you look at the top of the fo/autoidx.xsl file, you will see a parameter entity declaration and reference that you need to include in your customization layer. Then your stylesheet should at least compile without errors.
Your change is close, but not quite there. The context node for this template is d:indexterm, so the condition needs to have a more complete XPath:
<xsl:when test="d:primary/d:emphasis">
Your change makes the entire primary text italic even if emphasis is used for only one word in the primary, but I guess you are only using it for whole entries.
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net