Thanks to David Carlisle, I made an extensive example of what I wanted to achieve:
\documentclass{article}
\newcommand\lua[1]{\directlua{#1}}
\usepackage{fontspec}
% https://tex.stackexchange.com/questions/572212/
% substituting-fonts-for-emojis-in-lualatex/572220#comment1662059_572220
\lua{luaotfload.add_fallback("FallbackFonts", {
"Noto Color Emoji:mode=harf",
"Noto Sans CJK JP:"
})}
\setmainfont{Times New Roman}[RawFeature={fallback=FallbackFonts}]
% Get (command if defined)
\newcommand\Get[1]{\csname #1\endcsname}
% Lua get (if variable is not defined or
% argument is empty then nothing will be printed)
\newcommand\LGet[1]{\lua{tex.print(#1)}}
\makeatletter
% Global definition
\newcommand\Gdef[2]{\immediate\write@auxout{%
\unexpanded{\expandafter\gdef\csname #1\endcsname{#2}}%
}}
% Global Lua definition
\newcommand\GLdef[2]{\immediate\write@auxout{%
\unexpanded{\lua{#1 = #2}}%
}}
% Global Lua string definition
\newcommand\GLsdef[2]{\immediate\write@auxout{%
\unexpanded{\lua{#1 = "#2"}}%
}}
\makeatother
\begin{document}
After 2nd run we get:
\Get{super@ cool!!}
\setlength\parskip{1ex}
\ifdefined\simplename
\simplename
\fi
\LGet{this1}
\LGet{that2}
% Added nil check
\LGet{complex and complex.foo}
\LGet{complex and complex.bar}
% Later in document...
\GLdef{this1}{69}
\GLsdef{that2}{my Unicode string. やった!}
\GLdef{complex}{{foo = 123, bar = "string"}}
\Gdef{super@ cool!!}{%
Any string that I want
asdf
asdfasd
fasdfas
df asdf
as df \
sdf
asf a sdfs
}
\Gdef{simplename}{Can be used without the use of additional command. But will
give an error if not checked for definition (during the 1st run).}
\end{document}
Which will create PDF (with lualatex) after 1st run:

And after 2nd run we get:

\immediate\write\@auxout{\gdef\noexpand\wibble{my string]}then on the next run\wibblewill be defined from begin document to bemy string– David Carlisle Dec 17 '22 at 20:26