They can’t, but expressions also can’t control if a layer is active.
No more than they can change the layer order, the label color, the quality setting,…
Expressions are by definition only applied to keyframe-able properties.
Why would you need an expression to shy a layer, it has no effect on the render?
Scripting can set the .shy property of a layer without a problem though.