Lynn,
ACL doesn't have a boolean data type, just strings and integers; thus for locations where other languages would test a boolean, ACL tests whether a value is the number 0, the string "0", or the empty string, ", all of which evaluate as 'false'; everything else is treated as 'true'. So while "if (modified(doc) == 1)" would also work, the "==1" is unnecessary, since modified() returns 0 (false) if the document is not modified.
And, yes, once the document is saved, modified() will return 0. What modified() tests is whether the document contains changes that have not yet been serialized to disk via a save. I took that to be the point of the question. Apologies, if I misunderstood the question.