Edit: Carlos Cinelli's answer is the right one.
In this part we don't need to worry about unobservancy. We know DGP, so we know everything. We calculate expectations, as for standard probability calculus random variables.
In the first situation we can calculate $U$ as a function of X:
$U = \frac{(X - \epsilon_x)}{\delta}$
So then when we derive $Y$, it would be:
$Y = \beta X + \frac{\gamma}{\delta}(X - \epsilon_x) + \epsilon_y$
and after some simplification:
$Y = (\beta + \frac{\gamma}{\delta})X - \frac{\gamma}{\delta} \epsilon_x + \epsilon_y$
When we take expectation, we use assumption, that every $\epsilon$ has expectation zero and $X$ is equal to x. Then:
$\mathbb E(Y|X=x) = (\beta + \frac{\gamma}{\delta})x$
(So we can see, that the author of mentioned post made a mistake.)
The problem, that $U$ is not observed only has the consequences, that we can not calculate $\mathbb E(Y|X=x, U=u)$ using observed data. We would wish to do so in order to statistically estimate parameter $\beta$ instead of calculating observable $E(Y|X=x)$, which gives us some different value.
In second situation it is much easier, however when we set value of X, we change DGP, because we performed an experiment (which is denoted as $do(X=x)$):
- $U=\epsilon_u$
- $X=x$
- $Y=\beta X+\gamma U+\epsilon_y$
In this situation we just substitute for $X$ and $U$:
$Y=\beta x+\gamma \epsilon_u+\epsilon_y$
And calculate the expectation:
$\mathbb E(Y|do(X=x)) = \beta x$
In this situation we do not care about unobserved $U$, because we achieve desired effect, when we estimate this expectation with only $x$.