Since you are writing dialog and not quoting, the rule is simple:
Make it a complete sentence.
If your punctuation in dialog is part of the sentence, therefore it goes inside the quotes.
He asked, "Why should I do this?"
"Where are we going?"
"Let's get out of here!"
He yelled, "I want you to do this now!"
"I don't want to do this," I screamed back. Note the difference here.
Now, if you're characters are quoting other characters, that's when you do it differently:
He asked, "Did she say, 'I need to know' or 'I want to know'?"
As a side note, I've never ever heard of anyone using MLA to write a work of fiction. And novelists often break the rules for narrative purposes.
I think that Dickens is quoting the conversation in full but leaves our imagination to fill in the gestures that would occur during the exchange.
It is almost like a screenplay, but Dickens has not filled in the directions - we have to imagine them.
'As punctual as ever, ' he repeated, coming up to us.
[. . . Brusque exchange as she and Pip stand there, awkwardly afraid of him :-
'How do you do, Pip ?' (Rhetorical question; Pip nods or smiles or stands there rigidly afraid.)
Shall I give you a ride, Miss Havisham ? (Miss H smiles courteously and nods, yes.)
Once round ? (Miss H smiles and nods again, yes. ) . . . . . . . ]
'And so you are here, Pip ?'
Pip tells him when he arrived . . .
I think that Dickens has enclosed a brief and brusque exchange within his brackets in order to emphasise that the speaker is in total control of it all. Others are standing there woodenly responding, afraid of the man.
It is quite an effective literary device.
Best Answer
It's a common problem in programming. One technique is to use single and double quotes. For instance the search for the two words you could write as
Whereas the search for the phrase could be written
NB whitespace added for visual clarity.
Or you could just say
I think which I picked would depend on my audience.