The first display is a bit confusing, because it uses the symbol $n$ in two different ways. For the upper limit of the products and sums, it's the total number of "observations." But the symbol $n_i$ is later meant to represent the number of trials on "observation" $i$.*
I find it easier to work backward from Equation 13.9. If there were $n_i$ total trials on "observation" $i$ and $y_i$ of them had positive outcomes with an underlying probability $\pi_i$ (based e.g. on covariate values), then $n_i-y_i$ had negative outcomes with a corresponding probability $1-\pi_i$. That directly gives the result for the log-likelihood shown in Equation 13.9. If you then set $n_i = 1$, recognize that
$$y_i \ln \left( \frac{\pi_i}{1-\pi_i} \right)= y_i \ln \pi_i - y_i \ln(1-\pi_i)$$
and figure out that the bare $\pi$ in your first highlighted region should be the "observation"-specific $\pi_i$ (misprints do happen), then you should be able to show that the (corrected) equation at the top of page 425 is for the special situation of Equation 13.9 in which each "observation" only has a single trial.
With respect to the second part of your question, this answer shows that iteratively reweighed least squares is equivalent to a standard numerical search method in the case of a binomial model with a logit link. With $n_i$ still representing the number of trials on "observation" $i$, the formula $V_{ii} = n_i \hat \pi_i (1-\hat\pi_i)$ is the plug-in estimate of the binomial variance based on the estimate $\hat \pi_i$ for the true probability $\pi_i$ when there are $n_i$ trials. If there is only a single trial per "observation," that's just $\hat \pi_i (1-\hat \pi_i)$, the form shown in the links you provide (which implicitly assume one "trial" per "observation" in the terminology used by this cited text).
*The cited text seems to use "observation" to represent all cases that have the same set of covariate values. I tend to think of an "observation" as being the result of a single trial. I would have found it easier to follow had the word "case" been used instead.