You cannot "evolve" code that does not work. You're making needless and unnecessary changes at this point.
Hint:
Your original RX sketch works. The TX sketch radio code will work but there are simple logic errors preventing it.
Go back to your original code and debug your transmit logic. Add a Serial.begin(9600); block in setup() and then use Serial.println commands to echo values to the console to figure out what you're transmitting and you'll see some of your mistakes right away. Print all of the values of interest like this:
Serial.print("val= ");
Serial.print(val);
Serial.print(" old_val= ");
Serial.print(old_val);
Serial.print(" state= ");
Serial.println(state);
Among the errors is constant transmission. You only need to transmit a message when "state" changes. Fixing that will simplify the logic and you may see where you've gone wrong.