This word does not mean specifically what you are asking about, but it would be one example of an affectation, defined by Merriam-Webster as:
an unnatural form of behavior that is meant to impress others
1 a : the act of taking on or displaying an attitude or mode of behavior not natural to oneself or not genuinely felt
b : speech or conduct not natural to oneself : artificiality
Your scene seems to fall somewhere between the two sub-defintions, in that Randolph is speaking of Heather, momentarily pretending he is speaking to someone else, as though she isn't there. This behavior is not necessarily "[un]natural to [him]self" but is unnatural to the norm for the situation. In this case, it is "meant to impress" or at least to make her laugh.
I might borrow a bit from Max William's answer and write this as "Randolph took on the affectation of speaking to Heather in an imaginary aside, so as to continue the flirtatious nature of their conversation."