Your calculation that choosing at random (with probability $\frac 12$ each) whether to switch or stay put gives a probability $\frac 12$ of
winning the prize is perfectly correct.
Let $A$ be the event that your first choice is indeed the door that
conceals the prize. Then, $P(A) = \frac 13$ and $P(A^c) = \frac 23$.
Note that $A^c$ is the event that one of the two doors not chosen
conceals the prize. Once one unchosen door has been opened, you flip
a fair coin and switch or stay put according as the coin shows
Heads or Tails. If $W$ is the event that you win the prize, then
\begin{align}
W &= (A, T) \cup (A^c, H)\\
P(W) &= P(A)P(T) + P(A^c)P(H)\\
&= \frac 13\times \frac 12 + \frac 23\times \frac 12\\
&= \frac 12.
\end{align}
The "always switch" strategy can be put into this framework by
using a double-headed coin that always turns up Heads, leading
to
\begin{align}
P(W) &= P(A)P(T) + P(A^c)P(H)\\
&= \frac 13\times 0 + \frac 23\times 1\\
&= \frac 23
\end{align}
and similarly for the "always stay put" strategy, the chances
of winning are $\frac 13$. I leave it
to you as an exercise to figure out what the probability of
winning is if you choose to toss a biased coin that turns
up Heads with probability $p, 0 < p < 1$
and to show that this probability is smaller than the probability
of winning with the $p = 1$ "always switch" strategy.