It's actually working almost as I suspected. Thanks again.
The thing is that there's a short mute for dimmed tracks happening around 0 dB, though the meter is showing that the signal is still passed to the master channel from all those tracks.
In reality I'm gradually increasing dimmed track level up until the point when suddenly only the soloed tracks can be heard. Then, I turn my encoder one tick more, clockwise, and the sound is back again for those dimmed tracks. Can't figure out why is this happening.
Here's my current code which would be adjusted later, so that "solodimdb10" won't go higher than 0 dB or lower than (I guess) -250 dB. Is it the right range?