Do you think Marisa's humor is a coping mechanism to help her keep her nerves when fighting against overwhelming and often terrifying odds? It seems like Marisa is at her most easily intimidated when she's taken off guard by something, like Reimu suddenly showing up to attack her in IN Stage 4. It's not until after she gets a grasp on the situation and starts joking around that she seems to be back to her old, confident self.
Just food for thought, it's probably the other way around or maybe she just doesn't deal with surprises very well but it's fun to think about.