Thanks, a very useful tool indeed! But there's still a bug:
In draw.io, I typed some math formula with subscripts like $X_1(\omega_1)$ (LaTeX source:X_1(\omega_1)). After I run the script I got something like this: $X\_1(\omega\_1)$ (LaTeX source: X\_1(\omega\_1)).
Maybe a better way is to detect the math environments in .drawio file and do not escape the underscore in them.
The original .drawio file and LaTeX source are uploaded as a zip file in attachment, since uploading .drawio file is not allowed.
test.zip