First of all I don’t know if I misunderstood what you’re trying to do but the write line activity is used for debug. It writes a line in the output pane of your UiPath Studio.
Second of all you can escape double quotes in UiPath by using double quotation marks in your log or your write line
Example : I wrote in notepad your formula using a type text activity
Note that I used the double quotation for each quote, meaning I typed
As you can see it maintained the double quotes.
I used it for notepad but it should work the same when you type into Excel.
Hope this helped.