You might be looking for the <<remember>> macro.
Works fine. I had a slight problem that the variable kept being reset with every restart of the game; just added the following code to StoryInit:
<<if ndef $LoggedIn>><<set $LoggedIn = false>><</if>>
To stop it resetting the variable every time.
If I understand correctly you are comparing a password entered by the player (or hopefully loaded from storage) against a known value to determine if a cheat system should be enabled.
The problem with that technique is that the known value is contained within the source code of the story HTML file, and that source code is fairly easier to read for anyone with a little HTML knowledge (or the ability to google it) which means that the known value is is fairly easy to find. So anyone who can find it can by-pass that security system.
You could try changing the above technique to use some formula to determine if the entered (stored) password is correct, but again the source code applying that formula is accessible to the player so they are again able to by-pass it.
Anyway to answer your question about how to persist a value between play-throughs.
or as as suggested by @idling, the <<remember>> macro that I forgot SugarCube has.