Refactor conditionals in blockly.settingProperty