When Applejack saves Spike from some Timberwolves, Spike plegdes a lifetime of service to her, as dictated by his Dragon Code. Unfortunately the normally competent Spike turns out to be inept at farm chores, and his help is more trouble than it's worth. Applejack and her friends try to find some way to trick Spike into giving up his Dragon Code. The mane six put together a plot involving a fake Timberwolf, to try and get Spike to believe that he saved Applejack's life.
Unfortunately Spike is not so easily fooled, but when they are attacked by a real Timberwolf Spike gets the chance to save Applejack's life. The two decide that helping each other is just what friends do, and that Spike doesn't need to feel obligated to serve her for life.
It's always a risky proposition anytime something new is introduced. Especially when the new thing is the entire foundation of an episode. If done improperly the entire episode, regardless of how good everything else about it is, can fall apart. The Dragon Code is one of those things.
While there is an element of "Why was this never mentioned before?", my main concern with the concept of a Dragon Code is that I can't figure out if it's something all dragons do, or is it just Spike? When he first mentions his Dragon Code, he calls it his "Personal Dragon Code". Does this mean he's the only dragon that has a code like that, or do all dragons have a Dragon Code, but what that code is varies from dragon to dragon. I suppose it would be a little like the Ninja Way from Naruto if that's the case.
The fact that Twilight knows what a Dragon Code is, suggests that it's something that all dragons have (though why she suddenly knows so much about dragons I have no idea, considering there was no information to be found back in season two). Or, again, perhaps it's just Spike, and she knows about it because she knows Spike. Then again, the way she treats it makes it seem like something serious, and not something just Spike does.
The other major problem with the episode is that Spike is suddenly incompetent in order for the episode to work. At first I just thought it was because he wasn't used to the kind of work Applejack does, but after thinking about it I realized that didn't make much sense. A lot of what he was doing, like cooking or laundry, or cleaning, was work he should be used to doing for Twilight in the first place. I could understand if he was trying to help milking cows, or harvesting apples, but cleaning and cooking is what he does for a living.
I still enjoyed the episode, a big plus for this one being that all the main characters make an appearance. Pinkie pretty much steals the show with her mustache antics, and Fluttershy and Rainbow Dash's hoof bump after Spike compliments their sound effects was adorable. But even these fairly strong elements don't do much to salvage the overall story.
I won't say this was a bad episode, but it certainly wasn't as good as previous episode. The fact that most of the noticeable flaws are there to serve the plot doesn't help it's case. It's easier to forgive a bad episode that stays true to the characters, but a bad episode that is bad because it doesn't is a special kind of bad. Fortunately there's just enough to enjoy here that fans won't go rioting in the streets.