This looks right by me. Another way of phrasing the point is that the loop at steps 2--4 is doing "postselection"; this is clear also if you look at Fig. 3 on the top of page 7 where the (+) gate is present only when the measurement result is 1. Scott Aaronson showed that "Post-BQP" (BQP with postselection allowed) equals the complexity class PP, which contains NP and is equivalent to the counting class #P, so there is no surprise here.
I am the co-author of the textbook mentioned as "Lipton" in the comment by user dmmackay above.
I am the co-author of the textbook mentioned as "Lipton" in the comment by user dmmackay above.