When you are watching a television program like The Simpsons, you will find much dialogue that is not standard, grammatical English, and this sentence is definitely not because of the inconsistent use of the verbs.
The timing involved is such that the speaker really means "If you had asked me before you made that statement I would have said....." That is the only tense use that makes sense because of the "if." Once you have "if," you need a conditional verb form, meaning something would be true if the condition applied. The conditional form in this sentence involves the use of "would have." Here is another example:
If you had told me earlier, it would have saved me a great deal of work.
Notice that I have used the past perfect "had told" and then the present perfect "have said" in the sentence to indicate that the "had told" part, if the condition were met, would have to have occurred earlier than the "have saved" part.
Your analysis of this bit of dialogue is good because you have spotted the inconsistency in the verbs. Listening to the dialogue on television programs can be tricky, particularly on the popular animated shows, because there will be much that is grammatically incorrect or non-standard. If you need examples of good standard English, a public television station is likely to offer good examples, and listening to a public radio station that offers NPR programming is also good. The NPR programs often have transcripts available on-line that might be helpful to you.