Selecting 65000 SNPs where AF is close to 0.5 in all or most populations
Just use bcftools view for filtering:

$ bcftools view -i 'AF&gt;0.3 &amp;&amp; AF&lt;0.7' input.vcf.gz &gt; output.vcf


To truncate this list to 65,000 SNPs count the header lines, sum them to the number of SNPs you like to have and use head -n.

$ bcftools view -h input.vcf.gz|wc -l
255

$ bcftools view -i 'AF&gt;0.3 &amp;&amp; AF&lt;0.7' input.vcf.gz | head -n 65255 &gt; output.vcf