Document locking in LotusScript Agent code

I have a LotusScript agent that is calling the lock method on a NotesDocument object. In the documentation of the method it mentions that if the lock can not be placed it will give you False as a return value. When I try executing the lock method on a document that is locked I am getting an error message (“error message: Note is already locked by someone else”) in the NotesLog of the machine running the agent. The agent stops executing at this point and, and I am not getting the return value.

Am I just not understanding how this method should work, or is something not quite right here?