> best AND CHEAPEST sniper foam dart gun that has rails and a barrel attachment point under $20?
Four feet of CPVC with a rail and barrel lug glued onto it.
Stick a dart into the back end of it and blow.
The only thing cheaper than that is three feet of CPVC with a rail and barrel lug glued onto it. But that's considered the "carbine" version and frowned upon by snipers.
For $2.91 you've got cores for two of them, and a leftover piece to glue into a chunk of pool noodle as a melee-weapon handle.
Hot-glue one of these to it.
And then dig a broken SP-L out of a dumpster and salvage its barrel lug to glue to the muzzle, and you've got enough left in your budget to buy a scope.