I guess you couldn't call it lag so much. The game doesn't slow down, in fact the game acts normal. But during these two scenarios, the reaction time of the mouse is dropped significantly, making it difficult to choose an option
For dialog, the speed seems to return to normal after choosing a dialog option, but then will slow down again until making an NPC talk.
Mouse speed and reaction time returns to normal after exiting a terminal or dialog.