Serialize a document into a replayable batch script — the round-trip mechanism for editing a document by emit → modify → replay.