it randomly swaps the letters until it finds a word or fails to find one
That’s the right general idea, but the difficulty is how it “finds a word” or not. I couldn’t sort out how to make your project work, but I made one to show how it can be done.
I used the encoding described above to calculate a unique value for each word (and combination of letters) and Heap’s algorithm (linked above) to test all the letter combinations. A dictionary (set of clones) holds all of the values that the project knows to be words.
Using these ideas the project does 3 to 9 letter words with no code changes.
To add more words, just increase the number of dictionary clones & add another Set Dictionary Value block with the value of the new word. That value can be found by manually (swiping) setting the letters to the word & checking the greyed number in the bottom left.