You are right, @UserRoles is sufficient if only roles, no groups, matter
...which is what the OP's first post indicates
indeed, if one takes a closer look at the code.
FWIW, the resulting code looks very
similar:
var session:NotesSession = database.getParent();
var doc:NotesDocument = <your code here>;
var userNamesList = session.evaluate("@UserRoles", doc)
;