The Mishnah in Berachot (33b) rules as follows:
האומר על קן צפור יגיעו רחמיך ועל טוב יזכר שמך מודים מודים משתקין אותו.
IF ONE [IN PRAYING] SAYS ‘MAY THY MERCIES EXTEND TO A BIRD'S NEST’, ‘BE THY NAME MENTIONED FOR WELL-DOING’, OR ‘WE GIVE THANKS, WE GIVE THANKS’, HE IS SILENCED.
(Soncino translation, capitals in original)
The Talmud there explains that the problem with saying “modim” twice is that it makes it seem like there are two deities:
בשלמא מודים מודים משתקין אותו משום דמיחזי כשתי רשויות
We understand why he is silenced if he says ‘WE GIVE THANKS, WE GIVE THANKS’,because he seems to be acknowledging two powers;
(Soncino translation, capitals in original)
The Talmud further equates saying “shema” twice with saying “modim” twice:
אמר רבי זירא כל האומר שמע שמע כאומר מודים מודים דמי
R. Zera said: To say ‘Hear, hear’, [in the Shema’] is like saying ‘We give thanks, we give thanks’.
(Soncino Translation)
Elsewhere (Succah 53b) the Talmud questions the repetition of God’s name on the basis of this statement:
אנו ליה וליה עינינו כו’. איני והאמר רבי זירא כל האומר שמע שמע כאילו אמר מודים מודים אלא הכי אמרי המה משתחוים קדמה ואנו ליה (אנחנו מודים) ועינינו ליה מיחלות
WE ARE THE LORD'S AND OUR EYES ARE TURNED TO THE LORD etc. But can it be so? Did not R. Zera in fact rule, He who repeats Shema’, Shema’ is as though he said Modim, Modim [and he is silenced]? — The fact is that it was this that they used to say, "They worshipped the sun toward the east" but as for us we give thanks unto the Lord, and to the Lord do our eyes hope’.
(Soncino translation)
Apparently, then, using God’s name twice in a row is problematic, but not always. Rashi there explains that the exception is because in that instance they weren’t referring to the same thing twice, but to two separate things:
דכיון דאתרי מילי קמדכר ליה תרי זימני ולאו אחדא מילתא תרי זימני לית לן בה
For since it is for two things that it is mentioned twice, and not one thing twice, there is no issue.