Yes, the language $\mathcal{L}_M$ is used in writing down $\phi(m_1,\dots,m_n)$.
That is, if $\phi(x_1,\dots,x_n)$ is an $\mathcal{L}$-formula, it can't refer to elements of $M$ (except those named by constants). To express the fact that $\varphi$ is true of the tuple $(m_1,\dots,m_n)$ from $M$, let's add a constant symbol called $m_i$ for all $1\leq i \leq n$ and interpret $m_i$ in $M$ in the obvious way, namely as the element $m_i$. Now $\phi(m_1,\dots,m_n)$ is a sentence in the new, larger language. Formally, it's the sentence you get by substituting the constant symbol $m_i$ for the variable $x_i$ in $\phi(x_1,\dots,x_n)$.
If you add constant symbols in this way for every element of $M$, you can now write down all the first-order truths about tuples from $M$. This set of $L_M$-sentences is the elementary diagram of $M$. If you restrict your attention to atomic and negated atomic formulas, you get the atomic diagram of $M$.
For example, in the ring $\mathbb{R}$, $\pi^2 \neq e$ is a negated atomic $\mathcal{L}_{\mathbb{R}}$-sentence. There is no sentence in the language of rings which asserts that $\pi$ is not the square root of $e$. There's just no way to talk about these real numbers in the language of rings.
As for the motivation, the definition is preceded (this is from Marker's Model Theory: An Introduction, p. 44) by the sentence "Next we give a way to construct embeddings and elementary embeddings."
Ok, so the definition is supposed to be motivated by a desire to construct embeddings. After reading the definition, you might naturally wonder what it has to do with constructing embeddings.
Fortunately, this is answered by the very next lemma, which says that if $N\models \text{Diag}(M)$, then there is an $\mathcal{L}$-embedding $M\to N$, and if $N\models \text{Diag}_{\text{el}}(M)$, then there is an elementary embedding $M\to N$.
You have two errors here:
"$T$ is complete" means that for every sentence $\varphi$, $T\models \varphi$ or $T\models \lnot\varphi$. It does not mean that $\varphi\in T$ or $\lnot \varphi\in T$.
A basic formula is not just an atomic formula. It is an atomic formula or a negation of an atomic formula.
In your example, if $\mathfrak{A}\models \varphi$, then $t_1 = t_2\in \text{Diag}(\mathfrak{A})$ and $t_3\neq t_4\in \text{Diag}(\mathfrak{A})$, so $T\cup \text{Diag}(\mathfrak{A})\models \varphi$. Otherwise, if $\mathfrak{A}\not\models \varphi$, then either $t_1\neq t_2\in \text{Diag}(\mathfrak{A})$ or $t_3 = t_4\in \text{Diag}(\mathfrak{A})$, and in either case $T\cup \text{Diag}(\mathfrak{A})\models \lnot \varphi$.
It's an easy exercise to show that for any structure $\mathfrak{A}$ and any quantifier-free $L(A)$-sentence $\varphi$, either $\text{Diag}(\mathfrak{A})\models \varphi$ or $\text{Diag}(\mathfrak{A})\models \lnot \varphi$. The interesting fact is that $T$ is model complete if and only if $T\cup\text{Diag}(\mathfrak{A})$ decides the truth of all $L(A)$-formulas, even those with quantifiers. The answer by spaceisdarkgreen explains the easy proof of this fact.
Best Answer
Your idea to solve the problem by the method of diagrams and compactness is the right one. But the first thing you should ask yourself is: What is $B$, and what is its relationship to $A$? Can we take any model $B\models T$?
Well, no, we can't in general... Since we must have $\text{Im}(h)\subseteq \text{Im}(g)$, for all $a\in A$ there must be some $a'\in B$ such that it is consistent that $g(a') = h(a)$, where $h$ is some elementary embedding $A\to C$ and $g$ is some positive homomorphism $B\to C$. What does this consistency amount to? Suppose $\varphi(x)$ is a positive formula such that $B\models \varphi(a')$, where $h(a) = g(a')$. Then $C\models \varphi(g(a'))$, so $C\models \varphi(h(a))$, and $A\models \varphi(a)$. This is a constraint on $B$: If $A\models \lnot \varphi(a)$, then we must have $B\models \lnot \varphi(a')$.
So let's define a negative formula to be the negation of a positive formula, and consider the $L_A$-theory: $$T\cup \text{Diag}^-(A)\text{, where }\text{Diag}^-(A) = \{\psi(a)\mid \psi(x)\text{ is negative, and }A\models \psi(a)\}.$$
You can show by compactness that this theory is consistent, using our assumption that $A\models T_0$.
So $B$ be a model. $B$ is an $L_A$-structure, so when we form the language $L_B$, we reuse the constants naming the elements of $A$, i.e. $L_A\subseteq L_B$. Now consider the $L_B$-theory: $$\text{ElDiag}(A)\cup \text{Diag}^+(B)\text{, where }\text{Diag}^+(B) = \{\varphi(b)\mid \varphi(x)\text{ is positive, and }B\models \psi(b)\}.$$
It remains to show that this theory is consistent, using compactness and the fact that $B\models \text{Diag}^-(A)$.