I just tried your scenario and it works fine for me - please see the attached screen shot. If I enter ROH into my custom field and hit the Copy button, the Material Type dropdown will be correctly set to Raw Materials:
I'd assume ZCON does exist as a valid material type, correct?
Is your system fully up-to-date with all the necessary patches, notes and the latest Personas client installed?
Also, while it shouldn't matter in relation to being able to copy the value, the IF statement is not set up properly in your script. The statements belonging to IF should be indented (move them up with the arrow above the script lines so that they will be assigned to the IF).