Yes. It's pretty straightforward, too.
You can run an agent under a number of different triggers (I'd start with "scheduled", but once you've read up on it you can set up "after mail has been saved"). The email content is in a rich text field, and the NotesRichTextItem object can load it and hand it to you from .GetUnformattedText.
Also good to check: NotesDatabase.UnprocessedDocuments & NotesDocumentCollection.UpdateAll. Using these properly lets you see any new documents arriving after the agent's last run.
LotusScript is BASIC. So there's the ability to create & read/write files: "Open" / "Print"
Complicating this though -- when run on the server, the agent will predictably save to the server. You'll need to set security options (a tab when designing the agent) so that the agent is allowed to do this.
And of course once the file is there, you may want to save it somewhere. That's more a Windows thing with shared volumes, so I'll leave that to the complexities of Microsoft. If you want to email the result, you can do that, too.