basic turing machine I'm trying to create a TM that changes all $a$'s to $b$'s and all $b$'s to $a$'s in a given string and then halts on the first blank space it encounters. What I have is: 

$$ \langle q_1,a,b,q_1\rangle \\
\langle q_1,b,R,q_2 \rangle \\
\langle q_2,a,L,q_1 \rangle \\
\langle q_2,b,a,q_2 \rangle \\
$$

I'm new to Turing machines, so I'm wondering if it makes sense to convert $a$'s to $b$'s and then send $b$'s into a different state; is there a sort of temporal sequencing here that will send the $q_1$-manufactured $b$'s (former $a$'s) into $q_2$ as well? If so, how can you get around this problem to construct a suitable machine?
Using your convention that the machine EITHER changes symbol OR moves Left/Right, then this is the machine you are looking for:

&lt;q1,a,b,q2&gt;
&lt;q1,b,a,q2&gt;
&lt;q2,a,R,q1&gt;
&lt;q2,b,R,q1&gt;


In other words, the machine alternates between the 'switch the letter' state and the 'move right' state.  [I am adopting the convention that the absence of a transition - say on space - is equivalent to halting; otherwise one needs another transition to cover that]