Complex sentence: When Bart goes to Burns's mansion to retrieve his dog, Santa's Little Helper, along with other vicious dogs, tries to attack him but, remembering all the good times they had, snaps out of his brainwashed state.
Split into simpler sentences: When Bart goes to Burns's mansion to retrieve his dog, Santa's Little Helper, along with other vicious dogs, tries to attack him. However, when remembering all the good times they had, Santa's Little Helper snaps out of his brainwashed state.