In general, it is not so important: more recent treatments of mathematical logic do not need it.
See §2.1.: the letters $P, Q, R$ are used as placeholders for complete statements, i.e. they are propositional variables.
In §2.10, replacement is defined as the operation that produce from a formula $\mathcal F$ a new formula $\mathcal G$ replacing in $\mathcal F$ every occurrence of a placeholder $A$ with a formula $\mathcal A$.
Your first example with $A \lor \lnot A$ is correct.
We have to consider the comment : every formula derived by replacement from a valid formula (i.e. a tautology) is valid.
In §2.11 we have substitution: in this case "partial" replacement of sub-formulae is allowed, i.e. zero or more (some but not necessarily all) occurrences of a sub-formula $\mathcal A$ with an equivalent formula $\mathcal B$ into a formula $\mathcal U$ to get a new formula $\mathcal U^*$ wich is equivalent to the original one.
The issue is to have a rule of replacement that allows for the lack of a modern concept of schema.
If we want to express the "generality" of e.g. excluded middle, current presentations use schematic letters to formulate in the meta-theory the principle:
$\varphi \lor \lnot \varphi$.
We use it to "generate" all the needed instances of the law "replacing" the schematic letters with formulae of the calculus: $P \lor \lnot P, (P \to Q) \lor \lnot (P \to Q), \ldots$
If, as in the text, we operate at the "calculus level", all the above are different formulae. Thus the only way to express the "generality" of logical laws is to introduce a rule of replacement that allows us to (potentially) produce all the instances from a "basic" one.
You can compare it with the more terse (and rigorous) treatment by :
The rules of inference are the two following:
*100. From $[A \supset B]$ and $A$ to infer $B$ (Rule of modus ponens.)
*101. From $A$, if $b$ is a variable [ a propositional letter: $p,q,r,\ldots$], to infer $S^b_B A$ [ where $S^b_B A$ is the formula which results by substitution of $B$ for each occurrence of $b$ throughout $A$] (Rule of substitution.)