Basically, an epitaph is just user text that has been saved to life event #7 (the "creature died" life event). As long as you know what the Creature's moniker is, you can set its epitaph to whatever you want using the HIST UTXT command, like so:
hist utxt "creature-moniker-goes-here" 7 "your text goes here"
I tried this but it says "Life event doesn't exist for this moniker"
I looked in the creature history to find his moniker. I enterred this exactly :
hist utxt "001-rest-b7cfn-28fje-2ce7r-23vl7" 7 "RIP"