You can create a bunch of events like this:
If Character.State="STATE_RUN" -> Character set State to STATE_RUN
Unfortunately, there is no other way to access variables by their string name.
.
Also instead of the constant variables, you can use a dictionary:
Key="STATE_RUN", value="run"
KEY="STATE_IDLE", value="idle"
Character Set animation to StatesDictionary.Get(Character.State)