502.24 - Madness
502.24a - Madness is a keyword that represents two abilities. The first is a static ability that functions while the card with madness is in a player's hand. The second is a triggered ability that functions when the first ability is applied. The phrase "Madness [cost]" means "If a player would discard this card from his or her hand, that player discards it, but may remove it from the game instead of putting it into his or her graveyard" and "When this card is removed from the game this way, until that player passes next, the player may play it any time he or she could play an instant as though it were in his or her hand by paying [cost] rather than paying its mana cost. When the player passes next, he or she puts this card into his or her graveyard." [CompRules 2003/10/01]
502.24b - Playing a spell using its madness ability follows the rules for paying alternative costs in Rule 409.1b and Rule 409.1f through Rule 409.1h. [CompRules 2003/07/01]
502.24.Ruling.1 - The fine grain timing around this ability can be a bit difficult to follow. What happens is that if you discard the card (it does not matter why you are discarding), then you get the choice of whether or not you want a chance to play the card. If you don't want to, simply put it in your graveyard as normal. If you might want to, you do not pay at this time. Instead you remove the card from the game and put a triggered ability on the stack (as per those rules, see Rule 404). What this means is that players may respond to this trigger with other spells and abilities. Once any responses are resolved and both players pass, the triggered ability resolves. You can now play that spell just like you would as if it were in your hand (but it is not in your hand) by paying the Madness cost instead of the mana cost. And this spell can be played any time an instant is legal, regardless of its type. As normal, you can only play a spell or ability when it is your opportunity to do so. The text saying "until he or she passes next" means that you can choose to put other spells or abilities on the stack prior to playing the Madness spell. [D'Angelo 2002/02/23]
502.24.Ruling.2 - You are in no way required to play the spell even if you choose to remove it from the game. You can simply choose to pass when you have a chance to play something and the Madness spell is placed into the graveyard. The timing for putting it into the graveyard is also a bit odd since this is also a triggered ability. When you pass, put a triggered ability on the stack. When that ability resolves, the card is put into the graveyard. [D'Angelo 2002/02/23]
502.24.Ruling.3 - Madness does not allow you to discard the card just because you want to. Another spell, ability, or game rule has to cause the card to be discarded. [D'Angelo 2002/02/23]
502.24.Ruling.4 - There is an odd interaction with Rule 413.1 (the spell stack resolves or phase/step ends after both players pass in succession), because the last part of Madness can trigger on player A passing. This triggered ability is placed on the stack, then player B gets a chance to play something. If B passes, then the next item on the stack resolves or the phase/step ends without player A getting a chance to respond to their trigger. This doesn't really affect anything since player A could have played before they passed. [Jordan 2003/08/26]
Note - Also see Rule G13.1, "Madness".
As you can see under ruling 1, when you remove the card from the game instead of actually discarding it to your graveyard, a triggered ability is put on the stack. So when you do remove the logic during the resolving of wheel of fortune, a new item is placed on the stack. After the wheel has resolved, the stack is not empty yet (the trigger is there), so it will not be possible to play sorcery's yet. First the trigger of the logic has to resolve (with both players having the possibility to play instants and stuff).
Hope this clears it up.