Using "consult" prevents macrofication of your CCS, and the "if"/"endif" commands you're using exist only in KoL's combat macro language - they're simply ignored, otherwise.