Firstly, this code:
<xsl:variable name="index">
<xsl:value-of select="position()"/>
</xsl:variable>
<xsl:value-of select="$index"/>
is equivalent to
<xsl:variable name="index" select="position()"/>
<xsl:value-of select="$index"/>
which is equivalent to
<xsl:value-of select="position()"/>
Code gets easier to debug if you simplify it first...
Secondly, this code appears twice in your stylesheet. It appears in the <xsl:template match="system-index-block">, where it is only executed once and will output "1 of 3". It also appears in the <xsl:template match="system-file">, but that's only called within an <xsl:comment>, so the output won't be displayed.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference