Using -noroutineinwhere is good practice to prevent unwanted side effects from using a method or property in a WHERE clause.
For cases where the method always returns a constant, like Enum:GetValue(), this should be allowed though.
Even better would be if you could write:
FOR EACH Document NO-LOCK
WHERE Document.Status = DocumentStatus:Draft
Where Status is an integer field
[mention:04e040a388574bee96c841b1935762a5:e9ed411860ed4f2ba0265705b8793d05] There is an idea about automatically casting during assignments, and I think that the above ability to do the comparison fits in perfectly with that idea. Maybe you should add it as a comment to the idea. (I.e, the compiler can implicitly add the STRING() or INTEGER() or INT64() around the enum in your example above.)