Mystery Gift is for gaining bonuses from multiple stuff. It was originally used for getting free items in Pokemon Gold, Silver, and Crystal. Most of them were simple items, but when you were lucky, you'd get items for your room. On what it does for Ruby and Sapphire, I have no idea. And if I remember right, FireRed, LeafGreen, and Emerald used it at events to get rare Pokemon. Diamond and Pearl uses it for events, too. But also for Wii connection, as learned when you beat Pokemon battle Revolution, you get a surfing Pikachu to train on your game, using Mystery Gift. Those seem to be all the uses for Mystery Gift to current.