Dirtbike caps have a little nipple on top to which you connect a short loop of hose.
The idea is that evaporating gasoline will vent out of the hose, but actually flipping the bike upside down (or laying it down) won't immediately pour gas out the hole in your cap.
It's what you've described, but longer and looped back.
Stock gas caps do the same thing in a more complicated way. If you lay your moped on its side, gas _will_ start to drip out of the gas cap, but not immediately.