"The wise men had not penetrated Herod's design toward Jesus. When the object of their journey was accomplished, they prepared to return to Jerusalem, intending to acquaint him with their success. But in a dream they received a divine message to hold no further communication with him. Avoiding Jerusalem, they set out for their own country by another route. DA 64.1"
"And being warned of God in a dream that they should not return to Herod, they departed into their own country another way."
The EGW passage is a clear restatement and expansion of the biblical account of the wise men being warned in a dream not to return to Herod.
"In like manner Joseph received warning to flee into Egypt with Mary and the child. And the angel said, “Be thou there until I bring thee word: for Herod will seek the young child to destroy Him.” Joseph obeyed without delay, setting out on the journey by night for greater security. DA 64.2"
"And when they were departed, behold, the angel of the Lord appeareth to Joseph in a dream, saying, Arise, and take the young child and his mother, and flee into Egypt, and be thou there until I bring thee word: for Herod will seek the young child to destroy him."
The EGW passage directly recounts the events described in Matthew 2:13, including direct quotes. This is a clear and strong allusion.
"Through the wise men, God had called the attention of the Jewish nation to the birth of His Son. Their inquiries in Jerusalem, the popular interest excited, and even the jealousy of Herod, which compelled the attention of the priests and rabbis, directed minds to the prophecies concerning the Messiah, and to the great event that had just taken place. DA 64.3"
"When Herod the king had heard these things, he was troubled, and all Jerusalem with him."
The EGW passage expands on the statement in Matthew 2:3, explaining the impact of Herod's concern and the wise men's visit on Jerusalem. It's a thematic parallel, elaborating on the same event and its consequences.