The generally accepted theory we have about mopeds that suddenly start four stroking after running for a while is that fuel mix is getting kicked back into the air filter through the carburetor. After a while, the filter becomes so saturated that it begins blocking the air flow (thus enriching the fuel/air mixture). Too much fuel results in four stroking. Taking the air box off will not make your moped work better because your engine requires the resistance the airbox creates --indeed many people find their top speed <i>drops</i> when they remove their airbox.
You didn't mention what kind of moped you ride, but PA-50's are notorious for four stroking at top speed. If you let us know a little more about what you ride, and what conditions caused the four stroking (i.e. how long you were riding, what kind of fuel mix, etc.) we might be able to tell you how to fix the problem.
To figure out your average speed (in mph) take the distance you travelled (in miles), and divide it by how long it took (in hours --e.g. number of minutes divided by 60). You said it was 30 miles one way and that it took you 50 minutes. This would work out to 30 miles / 0.83 hours = 36 mph.