Here’s the code sample if anybody else is interested:
function fieldChanged(scriptContext) {
if(scriptContext.fieldId == "entitystatus"){
var fieldValue = scriptContext.currentRecord.getValue({
fieldId:"entitystatus"
});
if(fieldValue == ENTITY_STATUS_CLOSED_LOST){
scriptContext.currentRecord.getField({fieldId:"winlossreason"}).isDisabled=false;
} else if (fieldValue != ENTITY_STATUS_CLOSED_LOST){
scriptContext.currentRecord.getField({fieldId:"winlossreason"}).isDisabled=true;
}
};
}