I think my professor misunderstood something I said and may have taken offense; what should I do?
I think the best course of action is to explain what happened and apologize to the instructor. After that it is up to her if she is willing to accept your explanation and apology. Natural you should avoid repeating this attempt at joking in a classroom setting and save it for more informal environments.