I didn't check your algebra on your last step but it looks right.
to derive your accelearation relation, you don't have to "look at the strings" and think it through. in these more difficult problems you should derive a constant from the problem. In this case, the length of the string is constant. If I call the length from the wall to the stationary pully L1 the length from the stationary pully to the moving pully x and the length from the stationary pully to m2 y then I can derive the formula:
L1+x+x+y=LT
Where LT is the total length of the string. Takeing time derivatives of both sides twice:
[tex]2\ddot{x}+\ddot{y}=0[/tex]
then negnative sign you get should be argued away. So then you get the relations for acceleration that you derived.