Well, I have no idea how to legally put on a contest, but hosting a jam seems pretty straight forward. You pass the word along through bmx shops and websites, I wouldn't put out flyers cause then the police will find out. You tell your friends. You get someone with some kind of soundsystem and maybe a PA to announce stuff. Find the funniest person you can who also rides and have him on the mike. Make sure he swears a lot. Then have various contests, maybe make some challenges, like who ever can complete the sickest gap possible in your skatepark. Then hope that people throw down.
Make sure no one is in charge. This helps when the police come, that way they can only charge you for whatever it is you are actually doing at that moment.
Try to get some stores to donate some product at the jam. Maybe have riders contribute to prize money.
Hope you don't get in trouble for it. We used to hold comps like this all the time when I was younger and used to skate. Once or twice cops showed up and no one got in trouble. We all kind of acted like we didn't know what was going on and we shut off the sound system when they asked us to.