$$Y\bmod (X-4)=X-k,k>4$$ Which means:$$X\bmod(Y\bmod(X-4))\equiv X-(X-k)\equiv k, \quad\text{if}\quad k\leq\frac{X}{2}$$
Which means half the time your value is $4-k$
The real problem, is dealing with finding k and working the other half of the time. Without a general use of variables, There's less chance that it can be put as something simpler in all cases.
$$Y\bmod (X-4)=X-k,k>4$$ Which means:$$X\bmod(Y\bmod(X-4))\equiv X-(X-k)\equiv k, \quad\text{if}\quad k\leq\frac{X}{2}$$
Which means half the time your value is $4-k$
The real problem, is dealing with finding k and working the other half of the time. Without a general use of variables, There's less chance that it can be put as something simpler in all cases.