Let $C(X)$ be the algebra of continuous functions endowed with the compact-open topology.
Notice that the functions $d_x : X \to [0, \infty)$ given by $d_x (y) = d(x,y)$ separate the points of $X$: if $d_x (p) = d_x (q)$ for all $x \in X$, taking $x = p$ gives $d(p,q) = 0$.
Consider the subalgebra $A$ of $C(X)$ generated by the family $(d_x)_{x \in X}$ and the constant function $1$. Using the version of the Stone-Weierstrass theorem for the compact-open topology (Stephen Willard, "General Topology", 1970, p. 293, par. 44B.3), the closure of $A$ is $C(X)$, so you get a much stronger conclusion than the one you were interested in.