Proof

The algorithm stops since the set of points fixed by becomes larger every time one passes Step 2. Eventually the stabilizer of all these points will be trivial and the points form a basis.

The Order theorem implies that the output of the algorithm is the order of G.