The newer Javascript expression engine is more strict than the legacy extendscript engine. if/else statements cannot be on a single line. Try this instead:
if(thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider") == 5) {
100;
} else {
50;
};
I’ll note that you can change the expression engine you’re using by going to File>Project Settings and then picking the “Expressions” tab.