Assume $V$ as the universe of the interpretation and let $M \subseteq V$.
Thus, we will not use $V$ in the formulae and we'll use a predicate $M(x)$ to match the set $M$, i.e. $M(a)$ iff $a \in M$.
Let :
$S(a,b) \leftrightarrow a= \text {barber} \land M(b)$;
this is the translation of line 23): the definition of: $S= \{ (a,b) \mid a= \text {barber} \text { and } b \in M \}$.
Part 1 : from line 6) : $\text {barber} \in M$.
6) $M(\text {barber})$ --- assumed
8) $\forall a \ (M(a) \to [S(\text {barber},a) \leftrightarrow \lnot S(a,a)])$ --- assumed
9) $M(\text {barber}) \to [S(\text {barber},\text {barber}) \leftrightarrow \lnot S(\text {barber},\text {barber})])$ --- instantiating 8)
10) $S(\text {barber},\text {barber}) \leftrightarrow \lnot S(\text {barber},\text {barber})$ --- contradiction; thus, by $(\lnot \text I)$, discharging assumption 8), followed by $(\to \text I)$, discharging assumption 6):
12) $M(\text {barber}) \to \lnot \forall a \ (M(a) \to [S(\text {barber},a) \leftrightarrow \lnot S(a,a)])$
Part 2 : from line 13) : $\text {barber} \notin M$.
13) $\lnot M(\text {barber})$ --- assumed
23) $S(a,b) \leftrightarrow a= \text {barber} \land M(b)$
43) $\forall a \ [ M(a) \to \lnot S(a,a)]$ -- intuitively, if $S(a,b)$ holds only when $a= \text {barber}$ and we have assumed that $\lnot M (\text {barber})$, then when $M(a)$ we are forced to conclude that $a$ cannot be equal to $\text {barber}$ (simple derivation by contradiction).
63) $\forall a \ [ M(a) \to S(\text {barber},a)]$ -- by definition of $S$.
Using the tautological implication : $p \to q \vDash p \to (r \to q)$ we may derive respectively :
from 43) : 68) $M(x) \to [S(\text {barber},x) \to \lnot S(x,x)]$
from 63) : 72) $M(x) \to [\lnot S(x,x) \to S(\text {barber},x)]$.
Now, using the tautological implication : $(p \to q), (p \to r) \vDash p \to (r \leftrightarrow q)$, we conclude with :
75) $\forall a \ (M(a) \to [S(\text {barber},a) \leftrightarrow \lnot S(a,a)])$.
Finally, by $(\to \text I)$ from 13) and 65), discharging assumption 13):
76) $\lnot M(\text {barber}) \to \forall a \ (M(a) \to [S(\text {barber},a) \leftrightarrow \lnot S(a,a)])$.
Finally, from 12) and 76) by $(\leftrightarrow \text I)$ :
80) $\forall a \ (M(a) \to [S(\text {barber},a) \leftrightarrow \lnot S(a,a)]) \leftrightarrow \lnot M(\text {barber})$.
See Barber paradox :
A modified version of the barber paradox is phrased nearly identically to the standard paradox, but omitting a detail that allows an answer to escape the paradox entirely. For example, the puzzle can be stated as occurring in a small town whose barber claims: I shave all and only the men in our town who do not shave themselves. This version identifies the sex of the clients, but omits the sex of the barber, so a simple solution is that the barber is a woman. The barber's claim applies to only "men in our town," so there is no paradox if the barber is a woman. Such a variation is not considered to be a paradox at all: the true barber paradox requires the contradiction arising from the situation where the barber's claim applies to himself.
The "original" version of the paradox is expressed in FOL as :
$(\exists x) \ [{\text{man}}(x)\wedge (\forall y)({\text{man}}(y)\rightarrow ({\text{shaves}}(x,y)\leftrightarrow \neg {\text{shaves}}(y,y)))]$.
In this form, the predicate $\text{man}$ must be read as "human" and not as "male", and thus we cannot assume that $(\exists x) \ \lnot {\text{man}}(x)$.
In the modified (non-paradoxical) version, we assume that the "universe" $U$ is made of "men" and "women"; i.e. $W=U \setminus M$ and thus, assuming $x \notin M$ is equivalent to say : $x \in W$.