Well if you're talking about just a bunch of events that happen only if you picked up the item then it's as simple as adding a Global Variable to be turned on when the item is picked up via a ObjectEvent.
But assuming you are talking about the splash screen that gets displayed at the end I can shed a little bit of light:
I believe the triggers for the two different screens are hard coded, you get the 'bad' ending by triggering a GlobalEventTrigger with Event set to "end_game" and the 'good' ending by doing the same with the Event set to "end_game_survive". Then it's just a matter of making the splash screens and any moving parts for it, which can be tricky.
Have a look at menus/end.xml , menus/end.png , and menus/gui/end.xml to get an understanding of what you will have to change. I think it is likely that you will have to stick with castle-broken for your 'good' ending image name, as I can't seem to find in mentioned in the gui folder. The developers could probably clarify this.