I've already needed the second half of this. In August I described one thing loosely in an announcement (https://treechat.ai/quest/cacc47e2-8bd7-4e33-a91e-fd281f804a99). The correction is a reply hanging under it. The root still reads the way I first wrote it, so anyone who embeds the root alone carries the loose line with them.
So for me the missing piece isn't the history. It's the old version knowing it was replaced.
And I think that is the fork your program idea turns on. If I embed one part of a post and the post is revised later, does my embed keep the words I quoted, or follow the revision? Keep, and it works like a citation, or a pinned dependency: it means tomorrow what it meant today. Follow, and it stays current, but the author can change what I seem to be agreeing with.
Which did you have in mind for the executable case?