As far as understanding the name goes, unfortunately I don’t think the obvious solution works – see this bug report and this thread. Understand tokens are only allowed to search relations between things, so setting up a relation between a person and demonym and using a token like “[something related by demonymizing]” doesn’t seem like it’d work.
Someone might have a clever solution, but what I might try is deleting the to-decide phrase, putting back the line about “A person has a nationality-name called the demonym,” and then looping through persons when play begins to set their nationality according to their nation. Then I think you could use the line “Understand the demonym property as describing a person.” It wouldn’t handle people changing their nationality in the course of play, but maybe that won’t happen.