"David's nephew, Abishai, one of the bravest of his captains, could not listen patiently to Shimei's insulting words. “Why,” he exclaimed, “should this dead dog curse my lord the king? let me go over, I pray thee, and take off his head.” But the king forbade him. “Behold,” he said, “my son ... seeketh my life: how much more now may this Benjamite do it? let him alone, and let him curse; for the Lord hath bidden him. It may be that the Lord will look on mine affliction, and that the Lord will requite me good for his cursing this day.” PP 737.1"
"Then said Abishai the son of Zeruiah unto the king, Why should this dead dog curse my lord the king? let me go over, I pray thee, and take off his head."
The EGW passage directly quotes 2 Samuel 16:9 and provides context for the interaction between Abishai and David.
"Conscience was uttering bitter and humiliating truths to David. While his faithful subjects wondered at his sudden reverse of fortune, it was no mystery to the king. He had often had forebodings of an hour like this. He had wondered that God had so long borne with his sins, and had delayed the merited retribution. And now in his hurried and sorrowful flight, his feet bare, his royal robes changed for sackcloth, the lamentations of his followers awaking the echoes of the hills, he thought of his loved capital—of the place which had been the scene of his sin—and as he remembered the goodness and long-suffering of God, he was not altogether without hope. He felt that the Lord would still deal with him in mercy. PP 737.2"
"For I acknowledge my transgressions: and my sin is ever before me."
Both passages deal with the theme of acknowledging sin and its consequences. The EGW passage describes David's remorse and recognition of his sin, while Psalm 51:3 expresses a similar sentiment of acknowledging transgressions.