Here's the expression for rotation from your sample comp:
scalervalue = comp("Animated Comp").layer("Rotation").sampleImage([transform.position[0], transform.position[1]], [1,1])
value * scalervalue[2]
Ok, this is what is going on. The variable "scalar value" is taken from the Animated Comp and the layer Rotation using the sample image method that samples the color values of the AnimatedComp's Rotation layer. Here's the sample image method:
sampleImage(point, radius = [.5, .5], postEffect = true, t = time)
Only the point and radius need be defined. Point is an array so you write that like this. [x, y]. Here's what happens, The color value of the "Rotation" layer in the "Animated Comp" is sampled from the position property of the current layer with a radius of one pixel. The expression could have more simply be written by simply writing position[0], position[1] to create the array. No need for the extra transform. You don't need to include postEffect = true or t = time because those are the default values.
The second line simply multiplies the current value of the rotation by the variable's value. Since the sampleImage method returns the red green blue and alpha channel values the variable scalervalue[2] is returning only the green value. There actually should have been a semicolon at the end of the first line but because of a lucky coincidence the missing semicolon did not throw an error.
Does that help?