[guided]We want to add the next unused element of $M$ while keeping the map elementary on its finite domain. Let $i_s$ be the least index with $m_{i_s} \notin A_s$. If there is no such index, no forth extension is needed, and we keep the same map.
Assume $m_{i_s}$ exists. Write the finite domain $A_s$ as an ordered tuple $(a_1,\dots,a_r)$ with no repetitions. The existing map sends this tuple to
\begin{align*}
(c_1,\dots,c_r) := (f_s(a_1),\dots,f_s(a_r)).
\end{align*}
The key point is that atomicity gives control over the complete type of the enlarged tuple. Since $M$ is atomic, the complete type
\begin{align*}
\operatorname{tp}^M(a_1,\dots,a_r,m_{i_s}/\varnothing)
\end{align*}
is isolated by an $L$-formula $\varphi(x_1,\dots,x_r,y)$. This means two things. First,
\begin{align*}
M \models \varphi(a_1,\dots,a_r,m_{i_s}).
\end{align*}
Second, any tuple in any model of $T$ satisfying $\varphi$ realizes exactly the same complete type over $\varnothing$ as $(a_1,\dots,a_r,m_{i_s})$.
From $M \models \varphi(a_1,\dots,a_r,m_{i_s})$ we get
\begin{align*}
M \models \exists y\,\varphi(a_1,\dots,a_r,y).
\end{align*}
Now we must justify why the same existential assertion holds in $N$. If $r \geq 1$, the formula $\exists y\,\varphi(x_1,\dots,x_r,y)$ has free variables $x_1,\dots,x_r$, and the current map $f_s$ is partial elementary, so it transfers the truth of this formula from $(a_1,\dots,a_r)$ in $M$ to $(c_1,\dots,c_r)$ in $N$. If $r=0$, there is no tuple on which partial elementarity can be applied under our definition; instead $\exists y\,\varphi(y)$ is a sentence. Since $M \models T$, $N \models T$, and $T$ is complete, every sentence true in one model of $T$ is true in the other. Therefore in both cases
\begin{align*}
N \models \exists y\,\varphi(c_1,\dots,c_r,y).
\end{align*}
Choose $d \in N$ such that
\begin{align*}
N \models \varphi(c_1,\dots,c_r,d).
\end{align*}
Now define the extended map by sending the new element $m_{i_s}$ to $d$ and keeping the old values:
\begin{align*}
A_{s+1/2} &:= A_s \cup \{m_{i_s}\},\\
B_{s+1/2} &:= B_s \cup \{d\},\\
f_{s+1/2}|_{A_s} &= f_s,\\
f_{s+1/2}(m_{i_s}) &= d.
\end{align*}
We must check that this is actually a bijection, so $d$ must not already lie in $B_s$. Suppose instead that $d=c_j$ for some $1 \leq j \leq r$. Then the tuple $(c_1,\dots,c_r,d)$ satisfies the equality formula $y=x_j$. Since $\varphi$ isolates the complete type of $(a_1,\dots,a_r,m_{i_s})$, every formula true of a tuple satisfying $\varphi$ in a model of $T$ is true of $(a_1,\dots,a_r,m_{i_s})$ in $M$. Hence
\begin{align*}
M \models m_{i_s}=a_j,
\end{align*}
which contradicts the choice $m_{i_s}\notin A_s$. Thus $d \notin B_s$, and $f_{s+1/2}$ is a bijection from $A_{s+1/2}$ onto $B_{s+1/2}$.
Finally we verify elementarity of the extension. Let $\theta(x_1,\dots,x_r,y)$ be any $L$-formula. Because $\varphi$ isolates the complete type of $(a_1,\dots,a_r,m_{i_s})$, the complete theory $T$ decides whether every realization of $\varphi$ satisfies $\theta$ or every realization of $\varphi$ satisfies $\neg\theta$. Thus either
\begin{align*}
T \models \forall x_1\cdots \forall x_r \forall y\,(\varphi(x_1,\dots,x_r,y) \to \theta(x_1,\dots,x_r,y))
\end{align*}
or
\begin{align*}
T \models \forall x_1\cdots \forall x_r \forall y\,(\varphi(x_1,\dots,x_r,y) \to \neg\theta(x_1,\dots,x_r,y)).
\end{align*}
Since both $M$ and $N$ satisfy $T$, and since both enlarged tuples satisfy $\varphi$, we conclude
\begin{align*}
M \models \theta(a_1,\dots,a_r,m_{i_s})
\quad \Longleftrightarrow \quad
N \models \theta(c_1,\dots,c_r,d).
\end{align*}
This proves preservation for formulas in the displayed tuple. Any tuple from the finite set $A_{s+1/2}$ can be described by repeating and reordering variables among $x_1,\dots,x_r,y$, so the same argument gives preservation for every finite tuple from $A_{s+1/2}$. Therefore $f_{s+1/2}$ is partial elementary.[/guided]