Generally, yes. But –> This will be a global variable, and thus may potentially mess up any other scripts that also work with a global variable with that name. And making it a local variable will only scope to anything that you write during a single invocation of the console input, as that input is treated as a single Lua ‘chunk’.
There are ways around this (cough Consoletools cough), but they all involve an understanding of Lua that goes beyond vibe coding.