This is not a great solution. The point and mark will often move far away from where it was after replacing content, even inside a save-mark-and-incursion. There is a [RCS patch algorithm](
https://github.com/radian-software/apheleia/blob/main/apheleia-rcs.el) available in a third party package, but there's no built-in Emacs function that can do better than insert-file-contents in terms of speed and behavior.