Think of it as *all* 1xN matrices
[tex]
|n>=A=\begin{pmatrix}<br />
a\\b\\c\\\ldots<br />
\end{pmatrix}[/tex]
[tex]
<n|=A^\dag=\begin{pmatrix}<br />
a^* & b^* & c^* & \ldots<br />
\end{pmatrix}[/tex]
[tex]
\psi_n(x)=<x|n>[/tex]
Then you see that [itex]|m><n|[/itex] is a matrix ("sort of operator"). [itex]<m|n>[/itex] is a number (like the vector scalar product). Note that [itex]<n|m>\neq \psi_n^*(x)\psi_m(x)[/itex], however since [itex]\sum_x |x><x|=1[/itex]
[tex]<n|m>=\sum_x <n|x><x|m>=\sum_x \psi_n^*(x)\psi_m(x)[/tex]
So
1. don't rearrange |n> expressions
2. only numbers <n|m> commute
3. if you ever get to <x|n>, you can substitute with [itex]\psi_n(x)[/itex]