"The first error of David was his distrust of God at Nob, and his second mistake was his deception before Achish. David had displayed noble traits of character, and his moral worth had won him favor with the people; but as trial came upon him, his faith was shaken, and human weakness appeared. He saw in every man a spy and a betrayer. In a great emergency David had looked up to God with a steady eye of faith, and had vanquished the Philistine giant. He believed in God, he went in His name. But as he had been hunted and persecuted, perplexity and distress had nearly hidden his heavenly Father from his sight. PP 656.3"
The EGW passage describes David's feelings of being hunted and persecuted, which parallels the sentiments expressed in Psalm 142:3 about feeling overwhelmed and ensnared. While not a direct quote, the thematic connection is present.