You could try enabling the support mixed text direction
site setting. Have a look at What does the support mixed text direction setting do? for details about the setting.
When enabled, the setting adds a Toggle Direction button to the composer:
I haven’t tested this with the MathJax plugin, but it should make it a lot easier to write long equations. If you try the setting and run into any issues, please let us know.