~SURU+YOUNI is usually used when trying to achieve a certain result or make a certain circumstance/situation arise which may be out of the speaker's control.It's usually used with a potential form (できるように) because of this. The action after するように is the intentional action; the situation goes before. You can have different subjects both before AND after するように: 息子が家で仕事ができるように、父親が家を改築した。The father renovated the house so that the son could work from home.
~SURU+TAMENI is used to show purpose and/or cause:
私は息子を留学をさせるために、大金を使った。In order (to allow/for) my son to study abroad, I spend a lot of money (purpose).
息子が留学するために、私は大金を使った。Because my son was to study abroad, I spent a lot of money.
The actions taken for TAMENI must be something the speaker can do under their own will:
聞こえるために・ように、大きい声で話した。"I spoke in a loud voice in order to be heard." Cannot control whether or not others can hear you
よく冷えるために・ように、冷蔵庫に入れておいた。"In order to cool it quickly, I put it in the refrigerator." Cannot control how quickly something will cool down
日本語をそんなにうまく話すように・ために、これまでずいぶん時間とお金を使っただろう。"I guess it took (he/her/them) a lot of time and money in order to speak Japanese that well." Obtaining a certain level of fluency is something within one's control.