My friend and I were looking over some homework questions for an upcoming test in introductory topology, and one of the questions on the homework was to show that a metric space is normal. What we came up with on the spot was this:
Set $(X, d)$ a metric space. Let $A, B$ be closed and disjoint subsets of $X$. Then let
\begin{align*} U = \{x : d(x, A) < d(x, B) \}, \\ V = \{x : d(x, A) > d(x, B) \} \end{align*}
Clearly $U$ contains $A$, and $V$ contains $B$. Furthermore, $U$ and $V$ are each disjoint. The one thing left is to demonstrate openness, and this is where I want to be sure I have it.
Let $f : x \mapsto d(x, A) + d(x, B) i $ be a map from $X$ to $\mathbb{C}$. It's clearly continuous. Now, $U$ is the pre-image of $\{ a + bi : b > a \}$, an open set, so $U$ is open, and likewise for $V$.
I came up with this on the fly. I just want to be sure this method is sound.
Edit: It also just occurred to me that a simpler map to have used might have been $g : x \mapsto d(x, A) - d(x, B)$, and then look at the pre-images of positives and negatives.
Your method may be just a little unusual, but is sound (it might look a bit more natural with $\mathbb R^2$ in place of $\mathbb C$, but so what).
Here's an alternative approach: For each $r$, the sets $\{\,x:d(x.A)<r\,\}$ and $\{\,x:d(x,B)>r\,\}$ are open, hence so is the intersection $U_r:=\{\,x:d(x.A)<r<d(x,B)\,\}$ of these two. Then the union $U=\bigcup_r U_r$ is also open.