There is not any meaningful or any significant difference for in both cases the same reality of God's word is referred to. The Holy Scripture was customarily read aloud in synagogues, thus "you have heard" is matching to "it is written".
Thus, Jesus does not refer to Pharisees, Sadducees, or any Jewish theologians' interpretations of the Holy Scriptures when saying "you have heard", but to the Scriptures themselves. The crucial point here is another thing: Jews noticed that Jesus, in difference from Scribes and Pharisees spoke "as a one having authority" (Matthew 7:29). But what does it mean to "have authority"? Why it was so drastically different from the Scribes and Pharisees? Did He speak with a louder voice or with more sparkling eyes displaying a greater inspiration? Not, of course! The reference is not to how rhetorically impressively He spoke but the contents of His speech, the "what" of His speech.
Now, this contents is that He did not take a passage, a quote from Holy Scripture and then interpret it like the Scribes and Pharisees, but changing at will the very passage! Saying that henceforth not the previous passage should be quoted by theologians, but His novel words! That is to say, He substitutes the Scriptural passage with His words, giving a new Scripture. Exactly that is the essence of His scandal, that is the essence of people's bewilderment that "He is speaking as one who has authority to change the very Scripture and establish the new Scripture"! It is the same as when He authoritatively says: "I give you a New Testament" (Matthew 26:28), thus saying that He is either equal to or identical with the one who gave the Old Testament - God. For, in fact, only the one who has the equal and the same authority as God can change at will the words of God.
To give an analogy: if a Roman Emperor legislates: "Roman citizenship should be given only to the inhabitants of Latium and not to anybody else". Then, with changed circumstances in the world, when another Roman Emperor sees that now it will be profitable both for Empire's well-being to give citizenship to others as well, he overrules at will the previous legislation with a new one: "Roman citizenship should be given to all, who will provide a worthy service to it regardless nationality". But only Emperor can overrule an edict of an Emperor. Anybody else, who would do so, would be a criminal. The same here: unless Jesus is God, then overruling the word of God is nothing but a blasphemy. Therefore, the passage gives a clear indication of Jesus' claiming for Himself a divine authority.
One may ask, "but does God oppose God?", for Jesus clearly overrules the Scriptural precepts. Not of course, but God apportions commandments with a consideration of the condition of the listeners' abilities, measuring the commandment as optimal to this condition. In theology this divine consideration, measurement and apportioning is called "economy" (οἰκονομία). Thus, "eye for eye, tooth for tooth" is God's commandment, but the same God made it obsolete after coming to earth in human flesh to teach people the perfect gospel, that they may become as perfect as their Heavenly Father who has sent Him to them.