<meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Dynamic MathJax Macros</title>
     \\def\\state{\\mathbf{x}}
     \\def\\stateTransition{\\mathbf{F}}
     \\def\\discreteTime{n}
     \\def\\state{\\mathbf{s}}
     \\def\\stateTransition{\\mathbf{A}}
     \\def\\discreteTime{t}
    return MathJax.startup.promise = MathJax.startup.promise.then(() => {
     const {mathjax} = MathJax._.mathjax;
     const {STATE} = MathJax._.core.MathItem;
     MathJax.tex2mml(MathJax.config.TexMacros[name]);
     mathjax.handleRetriesFor(() => MathJax.startup.document.rerender(STATE.COMPILED));
     MathJax.startup.defaultReady();
     MathJax.config.setMacros('alt0');
     const dropdown = document.getElementById('naming-convention-dropdown');
     dropdown.addEventListener('input', (event) => MathJax.config.setMacros(event.target.value));
  <script id="MathJax-script" async
  <h1>Dynamic MathJax Macros</h1>
  <select id="naming-convention-dropdown">
    <option value="alt0">Alt0</option>
    <option value="alt1">Alt1</option>
  <p>Test inline: \( \state_{\discreteTime} = \stateTransition \state_{\discreteTime-1} \),
    and block: $$ \state_{\discreteTime} = \stateTransition \state_{\discreteTime-1} $$</p>
I've stored the functions and data needed for this in the MathJax configuration object (which becomes the MathJax.config object after MathJax is loaded) so as to reduce the number of global variables and functions. Â I store the macro definitions in an object with keys given by the values of your alternatives in the popup menu, so that we can use the same call to define either one. Â A setMacros() function switches sets (using MathJax.tex2mml(), which processes the TeX without it needing to be in the page) and re-renders the page. Â This is the key piece you were missing, since MathJax.typesetPromise() doesn't re-render any existing expressions. Â We ask the rendering to go back to the compile step (that converts LaTeX into the internal MathML), which is how your new macros get used. Â I've disabled the initial typesetting pass via setup.typeset in the configuration, since we do the typeset in the setMacros() function that is called in the startup ready() function.
Finally, I simplified your macros a bit, as the extra braces were not necessary, there was an extra backslash in the alt0 set, and the use of \it was unnecessary (and incorrect, since it gets you text italics, which aren't the same as math italics).
Davide