Take any pair of distinct points $x, y$. Define a partial order on the set of pairs of disjoint open sets $U \ni x, V \ni y$ by double inclusion (i.e. $(U_1, V_1) \preceq (U_2, V_2)$ if $U_1 \subseteq U_2, V_1 \subseteq V_2$). The set of pairs is nonempty, as $X$ is $T_2$. Then by Zorn's lemma, there is a maximal such pair $(U, V)$. I claim that if $X$ has the OEP, then $X = U \cup V$, and therefore $U$ is clopen.

Assume otherwise, and that there is some $z \notin U \cup V$. Then $z \in \bar{U}$, as otherwise, there would be some open set $W \ni z$ not meeting $U$, and $(U, V \cup W)$ would be a larger pair than $(U, V)$. Similarly, $z \in \bar{V}$.

Edit: Zorn's lemma is unnecessary. Let $U_1 \ni x, V_1 \ni y$ be disjoint open sets (as guaranteed by $T_2$). Then let $U = \overline{\text{int}(\overline{U}^c)}^c$, and let $V = \text{int}(\overline{U}^c)$. Note that $U = \text{int}(V^c)$ and that $V = \text{int}(U^c)$.

Define $f: U \cup V \rightarrow U \cup V$ by $f(U) = x, f(V) = y$. This is clearly continuous (as the preimages are $\emptyset, U, V,$ and $U \cup V$), so by the OEP, there must be some $g: X \rightarrow X$ extending $f$. But then because $X$ is $T_2$, we have that $f(z) = x, f(z) = y$ - a contradiction. Therefore, there can be no such $z$, so $X = U \cup V$. Therefore, $U = V^c$ is clopen, and $x \in U \not\ni y$, so we are done.

There's not much that requires the "target space" of the maps to be $X$; this proof works for any $T_2$ space. It also doesn't require $f$ to have outputs in $U$ specifically; having more than one point (and so can distinguish between $U$ and $V$) is enough.