If you can use C++, please try the function mdlCExpression_setValueForApp. Below is an example which turn off the select handle in PowerSelect tool's toolsetting dialogbox.
CExprValue value; value.type = CEXPR_TYPE_LONG; value.val.valLong = 1; mdlCExpression_setValueForApp (&value, NULL, "powerSelectInfo.prefs.disableControls", VISIBILITY_DIALOG_BOX, mdlSystem_findMdlDesc("PSELECT"));