I can’t get any animation in that gif to play, so it is a bit difficult trying to figure out what you’re hoping to achieve, but at a guess, I’d suggest taking a look at the linear expression.
This lets to map one set of values onto another, something like:
var newScale = linear(“moving layer’s”.position[0],250,500,100,25]
[newScale,newScale]
So you could take the moving layer’s position and as it’s X value (position[0]) moves from 250 to 500, the scale drops from 100 to 25.