According to the javascript tools guide "Justification only works if the value is set on creation, using a resource specification or creation parameters."
https://extendscript.docsforadobe.dev/user-interface-tools/control-objects.html?highlight=justify#justify
So it's not surprising it can't be changed later. But when I test your code I'm not even getting right justification unless I set it to multiline:false, so those two options may not work together. You didn't say if you encountered that issue, just that it 'does not work'.
If it was just a case of not being able to switch justification then I'd think you could fairly easily create a group with orientation 'stack' which would let you put multiple EditText in the same location, one for each justification, then switch visibility between them when you press the button. Then you'd just need something that filled in the text contents of the invisible one to that of the visible one when you make the switch.
But if like me you're not even getting right justification when multiline:true then that might be a dealbreaker anyway.