If a step doesn’t choose a number, proceed to the next.
Note: the phrase a’s distance to b or $d(a, b)$ in this post means $|a - b|$, where $|x|$ is the absolute value function. Note 2: as used in this post, the phrase A is dense around b means that the set of the distances of elements of A to B has no least element.
Note: as used in this post, the phrase $a \bmod b$ means the distance from the largest integer multiple of B smaller than a to a, or if there exists $n \in \mathbb Z$ such that $a = nb$, then 0.
Step 1: If there exists $n \in \mathbb E$ such that $|n| \leq |w|$ for any other $w \in \mathbb E$, choose $n$. (if we are to proceed, $\mathbb E$ has no smallest element with respect to distance to $0$)
Step 2: If there exists $n \in \mathbb E$ such that $|1 - n| \leq |1 - w|$ for any other $w \in \mathbb E$, choose $n$. (if we are to proceed, $\mathbb E$ has no smallest element with respect to distance to $1$)
Step 3: Set $a = 0$, $b = 1$. Call the interval $[a, b]$ $I$. If $P = \mathbb Z \cap I \cap E$, set $a = a - 1$, $b = b + 1$. Repeat until $I$ is non-empty. Call the set of all real numbers contained in I that are also members of $\mathbb E$ as $P$. If $|P| = 1$, choose its only element. (if we are to proceed, $|P| = 2$)
Step 4: If $P$ has a maximum, choose it. (if we are to proceed, $P$ is dense around its supremum)
Step 5: If P has a minimum, choose it. (if we are to proceed, $P$ is dense around its infimum)
Step 6: Define a function $λ(s, x, m) = x \bmod m^{-s}$. Repeat the following increasing s until you choose a number:
a. Set m = e.
b. For all numbers n that are elements of P, plot $(λ(s, n, m), n)$, and if multiple n cause the same $λ(s, n, m)$, then choose the greatest as the point to plot. An infinite conflict cannot occur since the interval is finite and $λ(s, x, m)$ is periodic with a finite period. —> (P is dense around every number $k$ where $k mod m^{-s} = 0$.)
c. If there is a point with the greatest distance from 0 or the most extreme x-value, choose the height of that point, which will be in E because it’s also in P.
d. If m = e, set m = 2, and go to step b. Otherwise, continue.
Incomplete and non-rigorous proof that Step 6 will always terminate:
($m$ can be $e$ or $2$)
If $P$ contains any intervals then $m^{-s}$ will eventually be smaller than the size of the interval and the endpoints of the plot of (λ(s, n, m), n) will be in P.
Call the set of all the numbers that $P$ is dense around $D$. Now, for every $M \in D$, there must be infinitely many points in $P$ around $M$, otherwise it would be possible to loop over each point and determine its distance to $M$ and find the minimum, which would violate the definition of dense around. For Step 6 to not terminate for some $s$, the following are required:
For some $M$, $M \bmod m^{-s} = 0$, so that there can be no least or greatest point $n \in P$ with respect to $λ(s, n, m)$.
There must be no $n \in P$ such that $n\bmod m^{-s} = 0$, otherwise it would be the least in the interval.
These conditions become untenable as the $m^{-s}$ becomes smaller and smaller and each successive value is linearly independent with the alternate value of $m$ (and the previous value of $s$, in the case of $m = e$). (This needs a rigorous proof).
Your algorithm seems convolution and unreadable. But without even reading it, I can happily tell you that it won't work.
If you can describe a choice function for arbitrary sets of reals, then you can prove that the real numbers can be well-ordered without using the Axiom of Choice. We know that this is not the case. Case in point, Paul Cohen proved that if $\sf ZF$ is consistent, then $\sf ZF+\Bbb R$ cannot be well-ordered is consistent as well.
But wait, there's more! It gets worse! You cannot even prove that there is a choice function from countable sets of reals.