What does the operator 'Range Detector' do in this block diagram? How can it be modeled?
According to the source that your block diagram is taken from [Udo Zölzer - Digitale Audiosignalverarbeitung], the Range Detector is an arbiter whose decision is not based on the output of the three nodes, but rather on the region of operation of the static characteristic that your calculated $x_{RMS}(n)$ is found in:

So, if $x_{RMS}(n)$ is below $NT$, the range detector chooses the lower node, if it is above $CT$, it chooses the upper node...

As you already noticed, that block diagram does have a few shortcomings when it comes to implementation:


It does not take into account edge cases like $|ET| &gt; |CT|$
There are more regions of operation than branches to process the RMS value. Even in the case where your RMS value is above expander threshold but below compression threshold you would be required to perform a set of logarithmic, multiplication, comparison, addition and exponential operations.
But it would be computationally more efficient to calculate whether $2 ^ {2 * ET} &lt; x_{RMS}(n) &lt; 2 ^{2 * CT}$ evaluates to true and if yes, you can set $f(n) = 1$ immediately without having to calculate $log_2(x_{RMS}(n))$ and so forth.
The lowest branch is not actually a noisegate but another expander with a (presumably) steeper slope.  Zoelzer defines the slope as $S = 1 - \frac{1}{R}$ while a Noisegate's ratio is defined as $R = 0$.
As you can see, the slope would thus evaluate to $NS = -\inf$ and the calculation of the whole lower branch becomes rather pointless.
Again, it would be more efficient to set $f(n)$ directly to $0$ in the case $x_{RMS} &lt; 2 ^{2 * NT}$ and save yourself a few pointless calculations.


As a matter of fact, Zoelzer seems to agree with the last point and provided a sligtly different block diagram in the book DAFX:


Please excuse the poor image quality. I highly recommend you get this book as well. It is a great addition to Digital Audio Signal Processing and provides Matlab demo code for most topics, dynamics processing included.