This SE question invites proofs of the fact that any open subset of $\mathbb R$ is a countable union of open intervals. The highest-voted answer there is of Brian M. Scott where they give the following argument:
Let $U$ be a non-empty open subset of $\Bbb R$. For $x,y\in U$ define $x\sim y$ iff $\big[\min\{x,y\},\max\{x,y\}\big]\subseteq U$. It’s easily checked that $\sim$ is an equivalence relation on $U$ whose equivalence classes are pairwise disjoint open intervals in $\Bbb R$. (The term interval here includes unbounded intervals, i.e., rays.) Let $\mathscr{I}$ be the set of $\sim$-classes. Clearly $U=\bigcup_{I \in \mathscr{I}} I$. For each $I\in\mathscr{I}$ choose a rational $q_I\in I$; the map $\mathscr{I}\to\Bbb Q:I\mapsto q_I$ is injective, so $\mathscr{I}$ is countable.
They then say that the
arguments generalize to any LOTS (= Linearly Ordered Topological Space)...
However, I don't agree that the argument indeed generalizes to arbitrary LOTS. For instance, consider $\mathbb Q$ under the topology due to the usual order. Now, take $U = (-\infty, \pi)_{\mathbb R}\cap\mathbb Q$. It is clear that there is only one equivalence class, namely $U$ itself. But $U$ is not an interval of the form $(-\infty, q)_{\mathbb Q}$ for some $q\in\mathbb Q$! (This problem does not arise in the case of $\mathbb R$ since $\mathbb R$ is order-complete so that all the convex sets are indeed intervals of the form $(a, b)$, $(-\infty, a]$, etc.)
Question: Is my concern valid, making the proof erroneous, and non-extensible to all the LOTS?
Here's a direct port of the argument in your link that applies to any separable LOTS. To do this, we need to define (as Thomas Andrews suggests in their comment) that an interval is a set such that $x,y\in I$ implies $[\min\{x,y\},\max\{x,y\}]\subseteq I$. This allows e.g. $(0,\pi)\cap\mathbb Q$ to be a subinterval of $\mathbb Q$ even though $\pi\not\in\mathbb Q$ (and avoids any discussion of completions).
What I think isn't actually particularly clear, even in the original, but especially without assuming $X=\mathbb R$, is that these equivalence classes are open. For example, if $X=[0,1]\cup[2,3]\setminus\mathbb Q$ as a suborder of $\mathbb R$, and we consider the whole space to be our open set, then we have the equivalence classes $[0,1]$ and $[2,3]\setminus\mathbb Q$. Then to show $1$'s equivalence class is open, you must observe something like that the $X$-interval $(0.5,2)=(0.5,1]$ is a basic open neighborhood of $1$ which is a subset of $1$'s equivalence class $[0,1]$.
Openness certainly can be proven in general, but there is some work to be shown that was hand-waved in your link.