You're right to apply it to Opacity. Sorry, I should probably have been clearer and not assumed so much. Your reading of the expression was bang on, but you didn't apply the data you got to the final result.
Here's the final expression:
a=thisComp.layer("Arrow").transform.rotation;
if (a>=360) a=a%360;
if (a<180 || a>240) 100 else 50
So what we're doing is feeding in the data we get from rotation%360 into your final if/else.
Does that make sense? And more importantly, does that work how you want it to?
Cheers,
Ben
Curious Turtle Pro Video
Training | Editing | Support
Out Now - Film Wash Color Effects Vol. 3
for After Effects & Apple Color