just to be sure: you first have to evaluate the upper block of code with the SynthDef in it and then the lower block with the OSCdef. they are enclosed separately.
message[3] is giving on/off, 1/0. the “message” variable is an array which contains [path, x, y, state(on/off)]. so the if statement is to make sure that the frequency only changes when you press, not when you release.