The middle mouse button hides the UI so you can just look at character and background sprites without anything in the way. So, if you hit the middle mouse button as a character is talking, then they will continue to talk (at least until they reach the end of that dialogue box). That much is intended behavior, same thing happens if you press "h" to hide the UI actually!