i'm not going to get into whether or not he was telling the truth, or even the whole story, and just give advice over what was stated...
first off, intent to sell is a very serious charge. my personal advice is that you contact a lawyer, and be absolutely 100% truthful with him.
and when you go to court, be respectful to the judge. that means. yes/no maam or yes/no sir, or even yes/no your honor. also, dress respectfully, that means a suit, or at the very least dress pants and a button up shirt. judges don't take kindly to people that are rude to them, and this seems especially true for teenagers that are rude to them. but definately lawyer. at least contact one, even if you don't have them represent you in court, they will have extremely valuable info for you.