"In the time of trouble just before the coming of Christ, the righteous will be preserved through the ministration of heavenly angels; but there will be no security for the transgressor of God's law. Angels cannot then protect those who are disregarding one of the divine precepts. PP 256.1"
"For he shall give his angels charge over thee, to keep thee in all thy ways."
The EGW passage directly echoes the principle of angelic protection for the righteous, as described in Psalm 91:11, while also adding a condition regarding obedience to God's law.