If $f$ is uniformly continuous on the dense set $E \subset X$ then a continuous extension of $f$ exists on $X$.
Your proof is mainly correct, although the notation might seem a bit confusing at times. I will try to write a cleaner version of what you did in the last paragraph, where you proved the uniform continuity of the extension of $f$, which is denoted exactly the same. Of course, I shall assume that $(X, d)$ is a complete metric space and by abuse of notation, I shall also denote the standard euclidian distance on $\mathbb{R}$ by $d.$
Let $\varepsilon > 0.$ Since $f$ is uniformly continuous on the dense set $E,$ there is $\delta_\varepsilon > 0$ such that $d(f(e_1), f(e_2)) < \frac{\varepsilon}{3}$ whenever $d(e_1, e_2) < \delta_\varepsilon$ and $e_1, e_2 \in E.$ Take now $x, y \in X$ such that $d(x, y) < \frac{\delta_\varepsilon}{3}.$ From the definition of the extension (thus implicitly the density of $E$), we infer that there are $e_x, e_y \in E$ such that $d(e_x, x) < \frac{\delta_\varepsilon}{3} > d(y, e_y)$ and $d(f(x), f(e_x)) < \frac{\varepsilon}{3} > d(f(e_y), f(y)).$ In particular, it follows from the triangle inequality that we also have that $d(e_x, e_y) < \delta_\varepsilon.$ Hence we have that $d(f(e_x), f(e_y)) < \frac{\varepsilon}{3}.$ Finally, applying once again the triangle inequality, we deduce that $d(f(x), f(y)) \leq d(f(x), f(e_x)) + d(f(e_x), f(e_y)) + d(f(e_y), f(y)) < \varepsilon.$ This proves the claim that the extension of $f$ is uniformly continuous.