The thing you have to remember if context. When you are filtering a COMMENT element in a predicate (the square brackets) you are within the context of that COMMENT element, so @ForTable is a valid attribute, but @TABLE_NAME does not exist on a COMMENT element.
You can refer to the XSLT function current() which returns the current context node from outside of the predicate (in this example that would be the COLUMN element).
Code:
<xsl:value-of select="//COMMENT[@ForTable = current()/../@TABLE_NAME AND @ForColumn=current()/@COLUMN_NAME]"/>
It may be easier to read/follow if you create temporary variables however:
Code:
<xsl:for-each select="TABLE">
<xsl:variable name="tableName" select="@TABLE_NAME"/>
<xsl:for-each select="COLUMN">
<xsl:variable name="columnName" select="@COLUMN"/>
<xsl:value-of select="//COMMENT[@ForTable=$tableName AND @ForColumn=$columnName]"/>
...