Not always far in advance. Sometimes I become hyper-aware of what I am supposed to say or do, and think in the moment, "This is the part where I ..." and then follow through with it. I remember distinctly doing this when I was around 18, and kept encountering people for the first time and them saying, "Nice to meet you." I always thought that was odd, as they had just learned my name and we'd had no discussion yet. This kept happening, and it occurred to me that this was social convention. So, I made a point of saying the same thing when I met someone new (even though I had no idea if it was in fact nice to meet them).
That was probably different from what you were talking about, but I also do rehearsals too. Especially if I am nervous about who I will be talking to. Job interviews, work parties, dates. In fact, I remember making a list of different aspects of my life and interests when preparing for date. Of course, none of it came back to me in the moment. But I kept the list as a memento.