My question is whether the second was is necessary or optional, and why?
As my condition stabilized, I was transferred to a different wing of the Hospital, and was gradually weaned off of the medication.
My question is whether the second was is necessary or optional, and why?
As my condition stabilized, I was transferred to a different wing of the Hospital, and was gradually weaned off of the medication.
It's optional.
The general rule for "and" is that the two things coordinated must share all relevant grammatical properties, and the new constituent created has all those shared properties. For the version without "was", we need to compare the properties of "transferred to a different wing of the hospital" and "gradually weaned off of the medication", then we see whether a constituent with all those properties can be put after "was". It can.
For the version with two "was"s, we need to do the similar analysis of the two "was" phrases to find whether the phrase that has all the shared properties (a predicate phrase with "was") is one that can be combined with the subject "I" to make a sentence. And it can.