Repeating a block of letters with M rows and N columns in every direction gives an infinite eight-direction word search. For example, this block
honi
hsin
builds the crossword
...honihonihonihoni...
...hsinhsinhsinhsin...
...honihonihonihoni...
...hsinhsinhsinhsin...
which runs on forever left, right, up and down.
Pick one square of the crossword at random, and one of the eight directions at random. Start at that square, step one square at a time in that direction, and read K letters. That gives a word of length K. Since the crossword is one block repeated, every square of the crossword matches some square of the block, so picking the starting square is the same as drawing one of the M×N squares of the block uniformly. The direction is drawn uniformly from the eight as well.
Run this trial twice, independently. Compute the probability that the two words are equal.