For example, if I have a start state of $i$ and a string $w$, how could I create a Turing machine that would halt when the tape content is $w \Box w$? The language is $\{a,b\}$.
My initial idea was a machine that:
On $i$, moves right and changes to $p$.
On $p$, if letter read is $a$, move $n+1$ cells to the right and change to $x$.
On $p$, if letter read is $b$, move $n+1$ cells to the right and change to $y$.
On $p$, if $\Box$, change to $h$.
On $x$, write $a$, move $n$ cells to the left and change to $p$.
On $y$, write $b$, move $n$ cells to the left and change to $p$.
On $h$, halt.
However, I don't think it'll work because Turing machines aren't allowed to move more than 1 cell at a time. Any help would be appreciated.