You want to figure out which property tells you that you are close to the position where you would scale (or move) the layer. I would expect that to be a specific rotation value of the layer. Let’s say the angle when the layer is at the right position is 90 degrees. You want to figure out how close to that rotation value the layer is and scale (or move in z space, if you prefer) based on that, within a given range. Let’s assume the range within which you want the scaling to happen is plus/minus 5 degrees. Then at 85 (or below) and at 95 (or above) degrees the scaling effect would be 0 and at exactly 90 degrees it would be 100. This means you want to convert the distance from the value 90 to the effect strength. Which, per my logic, would be:
my_effect_strength = linear(Math.abs(90-current_angle), 0, 5, 100, 0)
You would use that result as the multiplier for the effect you want to do — scale or z offset, or whatever works — added to current value.
You can use ease() instead of linear() for a smoother motion, but there are a couple of more values involved. Check the expression reference.
Kalleheikki Kannisto
Senior Graphic Designer