Just use isnewnote .
Set s = New NotesSession
Set doc = s.DocumentContext
Set db = s.CurrentDatabase
Dim maildoc As New notesdocument(db)
maildoc.Form = "Memo"
Dim rtitem As notesrichtextitem
Set rtitem = New NotesRichTextItem(maildoc, "Body" )
If doc.IsNewNote Then
Call rtitem.AppendText("Below is a link to a new document in the Database.")
Else
Call rtitem.AppendText("Below is a link to a revised document in the Database.")
End If
In a WQS agent you do not need to save the context document, it will be done automatically.
It is best to call a WebQuerySave agent (WQS<formname>) to make it east to find.