I'm still not sure what you mean. Story variables (i.e. $var) should be available to all passages across your story.
All story formats include syntax or macros for controlling the output of code and line breaks, if that's your issue. All story formats also include some way to display one passage in another passage so that the displayed passage's code can be run, and there are ways to combine this with the other methods of controlling your presentation to make this happen without yielding any output.
Harlowe and SugarCube also both have start-up / initialization passages for silently initializing variables. Something similar could conceivably be put together for Snowman and other formats.
Unfortunately, as you still haven't mentioned the story format and version of it that you're using, I can't really provide specific examples of any of this. I'm not sure I'm understanding you anyway, though.
Could you post examples of your code and describe what it's doing vs. what you want it to be doing? And please tell us which format and version you're using. You can find that information by clicking "change story format" in the little arrow menu near your story's title, if you aren't sure (in Twine 2).