Let me take a stab at this one:
First, I don't believe that it's very accurate to consider the use of
as if to be unreal. Adding the "as" makes It more of an approximation to something one is not. You are close or being treated or acting as such, even though you are not.
Why am I saying that? Because you stated that your intention was to create a specific type of sentence, as an abstract construct agnostic to any particular language.
If you are looking for a way to say something in your mother tongue, it might be helpful to give us context so we can find an something similar.
What does it mean in case?
The sentence "she looked at him as she would if he were a different person." As if means "it is almost the same but isn't truly or essentially the same."
On to the question:
She looked at him as if he were a different person.
She looked at him as if he had been a different person.
Both of these are using the same
as if construct to approximate to things that are similar but characteristically different in some essential way. The first one is using the subjunctive verb conjugation which doesn't connotation time, per se.
The second one uses the verb 'had known' which is referring to a person or essential state of being that he has since then transitioned from. He is no longer that. He is something else.
This transformation occurred in the past and the verb refers to that person he was before the transformation. She is looking at that man he was before he changed. She is seeing him "in that light," As you may frequently hear being said in English.
As for the second two sentences
She said it with such confidence, as if she knew something they did not.
She said it with such confidence, as if she had known something they did not.
The same thing is going on here as in the second sentence. One is in the past, her knowledge is in the same instance as her speech.
The fourth sentence is may be referring to her knowledge about or during an event that has already occurred.
So her knowledge is at t1 and her speech is at t2.
Examples might be? Anyone care to hark in?