This will do most of that, opening the file in your default text editor:
Function type: MS-DOS Batch Function
cd {sourcepath}
echo {date|dd MMMM yyyy} Lastname:>>readme.txt
start "" readme.txt
If the text editor you're using has a way to tell it to put the cursor at the end of the line via the command-line when opening the file, that'd be the best way to do things. I don't know if many editors allow that, though.
You could do similar by using JScript instead and sending a keypress to the editor after it opens, but you may need to play around with the amount of time to wait before sending the keypress. 100ms seemed to work for me, but if the keypress is missed or goes to the wrong place, try increasing it.
Stuff you might want to change is at the top of the script, in the three highlighted lines.
Function type: Script Function, Script Type: JScript
function OnClick(clickData)
{
var lastname = "Lastname";
var filename = "readme.txt"
var delayMS = 100;
var sourcepath = DOpus.FSUtil.Resolve(clickData.func.sourcetab.path);
var filepath = sourcepath + "\\" + filename;
var dateNow = DOpus.Create.Date();
var fso = new ActiveXObject("Scripting.FileSystemObject");
var textFile = fso.CreateTextFile(filepath, true);
textFile.WriteLine(dateNow.Format("D#dd MMMM yyyy") + " " + lastname + ":");
textFile.Close();
var cmd = clickData.func.command;
cmd.ClearFiles();
cmd.RunCommand(filepath);
DOpus.Delay(delayMS);
var wsh = new ActiveXObject("WScript.Shell");
wsh.SendKeys("{End}");
}
One difference between the two: The simple first one will append the line to the file if it already exists, which is a bit safer. The JScript second one will obliterate any existing file. You could modify the script to check if the file already exists first if you want to avoid that, using DOpus.FSUtil.Exists.