This is a SpongeKid SlightPants: Lunch Hour episode.
Spongebob realises Sandy is in love with Patrick, so he snaps her out by getting Patrick into trouble.
(Sandy is trying to kiss Patrick while Patrick is eating gum and Spongebob tries to snap her out of it)
Spongebob: Sandy, snap out of it!
Sandy: Leave me alone Spongebob (sighs at Patrick)
Spongebob: What should I do, because Patrick is so weird, Sandy likes him. I GOT IT. (time card 30 min later)
Lunch Lady: Patrick! Your in trouble for being weird. Now to snap the squirrel out is to slap her with a piece of bolony. (slaps Sandy with bolony)
Patrick: What did I do? (Lunch Lady takes Patrick to the prinipal's office)
Sandy: What happened? Why do I taste gum?