It might help to realize that these are not merely stock phrases, but are productive forms.
The pattern "In [verb]ing, [result]" means that by taking a certain action, a person achieves a particular result. The construction defines the result or the meaning of the action. "In doing so" is a particularly generic example. But it applies to plenty of other verbs. For example, the rules of chess say that if you touch a piece, you have to move that piece. So a person describing these rules could say that "In touching a piece, you force yourself to move that piece next." Or another example from this article: "In making this statement, it is the mother's intent to not comment at this time". This is trying to control the meaning of her action: she states what she is doing, and then the result that she intends for it to have. (Or, in this case, not have.) "In writing a book which is so different from his previous successes, the author is taking a big risk." If it is already understood from context, I could replace "In writing a book which is so different from his previous successes" with "In doing so". (This is just an example of using "doing so" to replace a longer verb phrase; you can interpret this "so" as meaning "that thing I just said".)
The "In [verbing]" constructions frequently take the form of performatives: "In riding this roller coaster, you agree to accept all responsibility for any injuries which you receive." My making that statement affects the legal reality: by defining the meaning of your action, I've turned a basic action into acceptance of a contract.
"In such a way that" is similar to "In [verb]ing", in that it's trying to describe the result of the verb which comes before it. However, this one is more of a stock phrase. It doesn't involve a changing component the way "In [verb]ing" does (with the verb). Here the pattern is something like "[verb phrase] in such a way that [result]". Going back to chess again, an example could be "He moved his knight in such a way that I would lose either my bishop or my queen." Or "He wrote his name in such a way that no one could read it." Some people consider this a less favorable construction than the one above, because it uses more words to mean the same thing. Then again, sometimes people don't want to be concise!
"In a way that" is more general in application: it is not restricted to describing the result of an action, but merely the manner in which it was done. So you could say "He wrote his name in a way that no one could read" (this doesn't specifically indicate the result, it's purely descriptive) or "He whistled in a way that I'd never seen before" (which is absolutely not describing the result of his decision).
Hopefully these will seem more comfortable or more familiar with more practice.