Yes, this is true. Recall first that any metric is equivalent to a metric bounded by $1$. Indeed, if $d$ is a metric, then $d’ = \min\{d, 1\}$ is such an equivalent metric, so we may choose a metric $d_X$ bounded by $1$ that generates the topology on $X$. By taking the closure of $S$, we may assume WLOG that $S$ is closed in $X$.
We now define our embedding as follows: Fix a countable dense subset $\{s_n\}_n$ of $S$. Let $Y = [0, 1]^{\mathbb{N} \sqcup X}$ be equipped with the following metric:
$$d_Y((r_i), (t_i)) = (\sum_{n=1}^\infty \frac{1}{2^n}|r_n - t_n|) + \sup_{x \in X} |r_x - t_x|$$
That is, the topology on $Y$ is pointwise convergence on coordinates labeled with natural numbers and uniform convergence on coordinates labeled with elements of $X$. Now, we define $\pi: X \to Y$,
$$[\pi(x)]_i = \begin{cases}
d_X(x, s_i)&, \text{ if }i \in \mathbb{N}\\
d_X(x, S \cup \{i\})&, \text{ if }i \in X
\end{cases}$$
I claim that $\pi$ is an embedding:
Continuity: For any set $A \subset X$, any $x, y \in X$, and $\epsilon > 0$, we note that there exists $a \in A$ s.t. $d_X(x, a) < d_X(x, A) + \epsilon$, so,
$$d_X(y, A) \leq d_X(y, a) \leq d_X(x, y) + d_X(x, a) < d_X(x, y) + d_X(x, A) + \epsilon$$
Letting $\epsilon \to 0$ shows $d_X(y, A) \leq d_X(x, y) + d_X(x, A)$. Similarly, $d_X(x, A) \leq d_X(x, y) + d_X(y, A)$, so $|d_X(y, A) - d_X(x, A)| \leq d_X(x, y)$. The RHS is independent of $A$, from which continuity of $\pi$ easily follows.
Injectivity and topological embedding: It suffices to show that, if $(x_n) \subset X$ and $x \in X$ are s.t. $\pi(x_n) \to \pi(x)$, then $x_n \to x$. We divide into two cases,
- $x \notin S$: As $\pi(x_n) \to \pi(x)$, we have,
$$\begin{split}
\min\{d_X(x, S), d_X(x, x_n)\} &= d_X(x, S \cup \{x_n\})\\
&\leq d_X(x_n, S \cup \{x_n\}) + d_Y(\pi(x), \pi(x_n))\\
&= d_Y(\pi(x), \pi(x_n)) \to 0
\end{split}$$
As $S$ is closed and $x \notin S$, $d_X(x, S) \neq 0$, so $d_X(x, x_n) \to 0$, i.e., $x_n \to x$.
- $x \in S$: Let $\epsilon > 0$. As $\{s_n\}_n$ is dense in $S$, we may fix $k$ s.t. $d_X(x, s_k) < \epsilon$. As $\pi(x_n) \to \pi(x)$, we in particular have $d_X(x_n, s_k) \to d_X(x, s_k)$. Thus, for large $n$, $d_X(x_n, s_k) < d_X(x, s_k) + \epsilon < 2\epsilon$. Hence, for large $n$,
$$d_X(x_n, x) \leq d_X(x_n, s_k) + d_X(x, s_k) < 3\epsilon$$
i.e., $d_X(x_n, x) \to 0$, so $x_n \to x$.
It now suffices to show that $\pi(S)$ is totally bounded, which follows easily by noting that, for $s \in S$, $\pi(s)$ has all its coordinates labeled by elements of $X$ being $0$, so $\pi(S) \subset [0, 1]^\mathbb{N} \times \{0\}^X$, and the latter is simply the Hilbert cube under $d_Y$.