Your idea and the previously given answer are similar in that they convert the string of $\texttt{1}$s into an alternating sequence.
Having just learned (as a result of this question) about that site that simulates Turing machines, I couldn't resist having a go at it myself.
Here's my solution.
The basic idea in this case is that we alternately change the first $\texttt{1}$ to an $\texttt{a}$ and the last $\texttt{1}$ to a $\texttt{b}.$
When no $\texttt{1}$ remains to be changed, we have
$\ldots\texttt{00aaa}\ldots\texttt{aabbb}\ldots\texttt{bb00}\ldots,$
with $n$ copies of $\texttt{a}$ and $n$ copies of $\texttt{b}.$
We then convert every $\texttt{b}$ to $\texttt{0}$ and every $\texttt{a}$ to $\texttt{1}$ and transition to the "end" state, which I consider to be the only accepting state.
This machine handles the case $n=0.$ When the input string contains an odd number of $\texttt{1}$s the machine stops in a non-accepting state.
And here's another machine.
This one uses only the symbols $\texttt{0}$ and $\texttt{1}.$
Unlike my first machine, this one does not attempt to write the output on the exact same cells as the first half of the input. Instead, it deletes the input two symbols at a time, always on the left end, and writes the output one symbol at a time on the section of the tape to the right of the input.
This repeats until there are no more input symbols to delete,
then the machine goes to the "end" state.
The case $n=0$ goes immediately to the "end" state, but if the length of the input is odd the attempt to delete the second $\texttt{1}$ eventually fails and the machine halts without reaching "end".