Here's another way.
To show that $B$ is open, we can take any $x \in B$ and show that there exists a ball $D (x, \varepsilon)$ such that $D (x, \varepsilon) \subseteq B$.
So, take arbitrary $x \in B$. Then we have $d (x, A) < \frac{1}{2}$. Consider the ball $C = D \left( x, \frac{1}{2} \left( \frac{1}{2} - d (x, A) \right) \right)$. We show $C \subseteq B$. For take any $x' \in C$. Then $d (x', x) < \frac{1}{2} \left( \frac{1}{2} - d (x, A) \right)$. By triangle inequality applied over the infimum,
$$d (x', A) \le d(x', x) + d(x, A) < \frac{1}{2} \left( \frac{1}{2} - d (x, A) \right) + d (x, A) = \frac{1}{2} \left( \frac{1}{2} + d(x, A) \right)$$
It follows from the above that $d(x', A) < \frac{1}{2} \left( \frac{1}{2} + d (x, A) \right) < \frac{1}{2} \left( \frac{1}{2} + \frac{1}{2} \right) = \frac{1}{2}$, so that $x' \in B$. Since $x'$ was arbitrary, we have that $C \subseteq B$. And since $x$ was arbitrary, $B$ is open.
Note that we did not have to use the fact that $A$ is closed. The proof still applies if $A$ is not closed.