You'll need a macro to do this, but basically you split each word into letters, sort the letters into alphabetical order, and then check if the results match. I have C code to do this which you can find here, but translating it into a LibreOffice Basic macro would require work. I think LibreOffice now supports Python macros, and it might be easier to translate C into Python.