Did you ever get this resolved? I am getting this same error, even using a formula that returns in all cases...
import System static def GetAttributeValue(Incident): HideOtherCat = true MandateOtherCat = false if Incident.Category.Title.ToLower() == 'other': HideOtherCat = false MandateOtherCat = true return String.Format(":SetHidden(_OtherCat,{0});:SetMandatory(_OtherCat,{1});",HideOtherCat,MandateOtherCat)
I have already performed an iisreset - it did not resolve.