Pending users will make more sense if you take out the line:
and membership_rels.member_state = 'approved'
in <fullquery name="select_non_dotlrn_users">
in all the users-chunk-small/medium/large-yourdbhere.xql
Then you will see unapproved users and suddenly realize you want to create a oneclick "approve and make a dotlrn" user link.