the author explains why a three-dimensional universe implies an inverse square law.
This explanation is an appeal to your intuition, but it does not explain "why" the electric (or gravitational) force is an inverse square law in three dimensions. For example, it does not explain "why" the electric force should depend on "how concentrated the lines of force are." It only asserts this and then indicates that if this is true then somehow the force must be an inverse square law.
We can say other things to explain how inverse square laws relate to the equations of motion for photons and gravitons and their sources, but ultimately physics is based on experiments and our explanation (our theoretical physics) needs to fall in line with the experimental results.
Suppose I told you that a photon was a massless particle, and that such a particle has a momentum-space propagator that looks like
$$
D(p) \sim \frac{1}{p^2}\;.
$$
And suppose that I further told you that I can figure out the force law by taking the derivative of the Fourier transform of the propagator like
$$
F(r) \sim \frac{d}{dr}\int d^3 p e^{-i\vec p\cdot \vec r} \frac{1}{p^2} \sim \frac{1}{r^2}\;.
$$
And suppose that I further told you that in $D$ dimensions the force should look like
$$
F_D(r) \sim \frac{d}{dr}\int d^D p e^{-i\vec p\cdot \vec r} \frac{1}{p^2}
\sim \frac{1}{r^{D-1}}\tag{1}\;.
$$
Does this explain "why?" I don't think so. But it does link some notions of massless force carriers to the force laws and the dimensionality of space.
Further, it is a textbook problem to determine the fields due to a point charge, an infinite line of charge, and an infinite sheet of charge, in three dimensions, using Gauss's law. Such calculations end up providing the same results as Eq. (1), namely that the field due to a point charge falls off as $1/r^2$, the field due to the line charge falls off as $1/r$, and the field due to the sheet of charge is constant (on one side of the sheet).