You can not. Not with SynEdit.Lines.
You can read from SynEdit.Lines. But for writing you will have to use TextBetweenPoints (there are several other with similar names)
SynEdit.TextBetweenPoints(Point(1,y), Point(length(SynEdit.Lines[y-1]),y)] := 'foobar';
'
I think lines[] is zero based, but TextBetweenPoints is 1 based, pleas double check.
Of course that will add all your changes to the undo list (you can use BeginUndoBlock, EndUndoBlock, to make it just on undo.
The way undo info is stored, it requires that all undo info is present. If you make changes to the text, and that would not be part of the undo, then the position of all other undo blocks would be wrong. Thats why all actions must be part of the undo.
--------------
You can use TextBetweenPoints to replace the entire text, instead line by line.
But that will add a copy of the entire old text to the undo info.