My main comment at first would be that the verb form on each side of "or" should match. So in the first pair
David will either write or have written.
is OK. The next one it should be
David either will write or will have written.
Next sentence:
She likes either swimming or studying.
or
She likes either to swim or to study.
In the next pair, the correct verb is drank.
I drank either coffee or tea.
but
I either drunk coffee or tea.
is wrong because the options attached to either are the coffee and tea, not two actions like drank or xx. But you could say
I either drank coffee or ate cake.
basically its that you either drank or ate.
Usage of either in the other sentences except this last one seems OK, since that is your main question. You just have to be careful either is referring to choices of nouns or verbs.
Sorry as for the last section I am not sure what you are asking. Could you add an example for each case?
First of all, for similar phrases like this, I never like to say that they are interchangeable, because that implies that they connotate the same thing. There is usually a best choice to make. While the denotation of the phrases might be interchangeable, providing an incorrect connotation could lead to confusion on the part of the reader or listener of your sentence.
So let discuss connotation with an example.
In doing so:
Bob walked his dog. In doing so, he exercised.
The first phrase in doing so gives the impression that effect of his first action (walking the dog) wasn't at all intended to cause the second. He exercised, but this occurred only as a side benefit.
In this way:
Kathy finished watering her plants and set down the hose. In this way, the hose would be close by for next time.
In this example, the phrase in this way is used. It is implied that Kathy desired the results described in the second sentence. She wants the hose close by. However, it isn't a very strong desire. If her husband comes and stores the hose, she will just get it out again.
So that:
Fred went to Law school so that he could get a degree.
In this example, Fred performed the first action (law school) expressly for the purpose of achieving the second action (get a degree). This was his entire goal.
I'll change out the last example with a different phrase for clarity:
Fred went to Law school. In doing so, he could get a degree.
If you said this, a listener might be confused. They might ask "Did he want the degree?" or "Did he have another reason for going?" Maybe Fred's main purpose was to party with college students and blow off classes.
Conclusion:
Remember that changing out these phrases for each other will still make sense. It will still be grammatical. But it will connotate a different mindset on the part of the subject.
Best Answer
Yes, it is grammatically correct, however it doesn't sound natural and I wouldn't expect a native English speaker to use it (although I suppose there might be some context in which it would be sensible).
Your third example,
although both grammatically correct and how a lot of native English speakers would word that concept, is something that would grate on the ears of quite a few people. It does sound somewhat coarse.