You have a simple variable scoping problem.
Variables are scoped to their immediate parent. They do not exist outside of it.
Just reverse your approach. You want the variable contents depend a template call, after all. The variable itself must be declared in the same spot where you want to use it.
<xsl:template name="test">
<xsl:choose>
<xsl:when test="boolean(.)">
<xsl:value-of select="'want to store this and return to previous template'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'maybe I want to store something else here'" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<file_item_nbr>
<xsl:variable name="result">
<xsl:call-template name="test" />
</xsl:variable>
<xsl:value-of select="$result"/>
</file_item_nbr>
</xsl:template>
Note that the current node does not change when you do xsl:call-template>
, i.e. the meaning of .
stays the same as in the calling template.
The two ways to modify a result of <xsl:call-template>
are either
<xsl:variable name="temp">
<xsl:call-template name="test" />
</xsl:variable>
<xsl:variable name="result">
<xsl:value-of select="$temp + 2" />
</xsl:variable>
or, a bit nicer by nesting variables:
<xsl:variable name="result">
<xsl:variable name="temp">
<xsl:call-template name="test" />
</xsl:variable>
<xsl:value-of select="$temp + 2" />
</xsl:variable>