A freewheel sprocket turns freely in one direction, but, not in the other. It has a racheting action
The preferred place to put the freewheel is at the rear axle, but, when the sprocket is on the left side of the axle (when facing forwards) the freewheel must thread onto the axle using left-hand threads, so that the action of the motor/chain pulling on it tighten the freewheel. The other issue is that the left-hand thread freewheels that are available are of 'iffy' quality, and BMX sprocket sizes are very limited to about 18 teeth.
If you put the freewheel at the drive end, it would need standard, right-hand threads. Standard RH thread freewheels are available with sprockets ranging from 16 to 22 teeth. And, you can get high-quality freewheels with RH threads. The disadvantage is that the drive chain is 'coasting' along with the bike, but, chain losses are very small (if properly aligned, the drag due to the chain is only in the 2 to 3 percent range.)
Most of the drag you encounter with your current setup when coasting is probably due to engine braking - just as if you let off the gas with a standard transmission in an auto.