"So if I go to court to see about dismissing the case based on the previous lack of discovery by the prosecutor, is it likely that the judge will deny the dismissal?"
I have ESPN not ESP.
"If the judge does deny the dismissal based on lack of discovery, will I have to prove that I was not breaking the law right then and there in court, or will I get a new court date to do that?"
From what you tell me, you should get a new court date.
None of your factual statements are defenses to what you are charged with.
BUT the prosecutor's failure to do anything about the discovery request would've gotten the charge tossed in my court! There's no excuse for that. BUT again, the judge may just give the prosecutor a continuance and reset the court date.
And, as I said, nothing you have said in the posts would show you are not guilty of the offenses.