Unfortunately, the rich text is not written to disk until after the save, and the $Links item doesn’t need to exist at all for there to be a doclink. These two facts together make it very unlikely that your QuerySave will work. You may have to do a Post save type check.