I start with a general concept, then build up an outline with a few scene ideas, then move on to a specific page breakdown. The page breakdown will have dialog and actions written out, sometimes it's just [they argue] or [they fuck] and I fill in the details later.
I usually have the entire page breakdown written before starting a comic. For this comic I would sketch a few pages, do the dialog to make sure the page breaks lined up, then color that batch, then post and start on the next batch. If you're asking if I made this up as I went along, no - the loop was the concept from the beginning. When I got the the overlapping parts I massaged the dialog and action a bit to make sure things mostly fit with what I had already written.
For the next comic, Crossworld VR, I rough sketched the entire comic with complete dialog before coloring anything. Partially for efficiency but also since it was a commission I wanted the customer to approve the plot before I commit to a huge amount of work.