Note: it is always worth trying to plot out the structure of a passage of scripture oneself, and only then look for ideas from others. Here is a proposal, eventually with help from David Dorsey who has a 7 part structure. The centre is a section directed to YHWH.
To the chief Musician, A Psalm of David, the servant of the LORD, who spake unto the LORD the words of this song in the day that the LORD delivered him from the hand of all his enemies,
and from the hand of Saul:
And he said,
B. YHWH the Rock
1 I will love thee, O LORD, my strength.
2 The LORD is my ROCK (Sur), and my fortress,
and my deliverer (palat);
my God, my strength, in whom I will trust;
my buckler, and the horn of my salvation, and my high tower.
3 I will call upon the LORD, who is worthy to be praised:
so shall I be saved from mine enemies.
C. Cry of psalmist heard
4 The sorrows of death compassed me,
and the floods of ungodly men made me afraid.
5 The sorrows of hell compassed me about:
the snares of death prevented me.
6 In my distress I called upon the LORD,
and cried (sawa) unto my God:
he heard my voice out of his temple,
and my cry came before him, even into his ears.
D. YHWH’s deliverance
7 Then the earth shook and trembled;
the foundations also of the hills moved
and were shaken, because he was wroth.
8 There went up a smoke out of his nostrils,
and fire out of his mouth devoured:
coals were kindled by it.
9 He bowed the heavens also, and came down:
and darkness was under his feet.
10 And he rode upon a cherub, and did fly:
yea, he did fly upon the wings of the wind.
11 He made darkness his secret place;
his pavilion round about him
were dark waters and thick clouds of the skies.
12 At the brightness that was before him his thick clouds passed,
hail stones and coals of fire.
13 The LORD also thundered in the heavens,
and the Highest gave his voice;
hail stones and coals of fire.
14 Yea, he sent out his arrows, and scattered them;
and he shot out lightnings, and discomfited them.
15 Then the channels of waters were seen,
and the foundations of the world were discovered
at thy rebuke, O LORD,
at the blast of the breath of thy nostrils.
16 He sent from above, he took me,
he drew me out of many waters.
17 He delivered me from my strong enemy (oeyb),
and from them which hated me (sane):
for they were too strong for me.
18 They prevented me in the day of my calamity:
but the LORD was my stay.
19 He brought me forth also into a large place (merheb);
he delivered me, because he delighted in me.
E. David is upright
a. 20 The LORD rewarded me according to my righteousness;
according to the cleanness of my hands hath he recompensed me.
b. 21 For I have kept the ways of the LORD,
and have not wickedly departed from my God.
c. 22 For all his judgments were before me,
and I did not put away his statutes from me.
b’. 23 I was also upright (tamiym) before him,
and I kept myself from mine iniquity.
a’. 24 Therefore hath the LORD recompensed me according to my righteousness,
according to the cleanness of my hands in his eyesight.
F. The ways of YHWH
25 With the merciful thou wilt shew thyself merciful;
with an upright (tamiym) man thou wilt shew thyself upright (tamam);
26 With the pure thou wilt shew thyself pure;
and with the froward thou wilt shew thyself froward.
27 For thou wilt save the afflicted people;
but wilt bring down high looks.
28 For thou wilt light my candle:
the LORD my God will enlighten my darkness.
29 For by thee I have run through a troop;
and by my God have I leaped over a wall.
E’. YHWH is upright
30 As for God, his way is perfect (tamiym):
the word of the LORD is tried:
he is a buckler to all those that trust in him.
31 For who is God save the LORD?
or who is a ROCK (sur) save our God?
D’. YHWH’s deliverance
32 It is God that girdeth me with strength,
and maketh my way perfect (tamiym).
33 He maketh my feet like hinds’ feet,
and setteth me upon my high places.
34 He teacheth my hands to war,
so that a bow of steel is broken by mine arms.
35 Thou hast also given me the shield of thy salvation:
and thy right hand hath holden me up,
and thy gentleness hath made me great.
36 Thou hast enlarged (rahab) my steps under me,
that my feet did not slip.
37 I have pursued mine enemies, and overtaken them:
neither did I turn again till they were consumed.
38 I have wounded them that they were not able to rise:
they are fallen under my feet.
39 For thou hast girded me with strength unto the battle:
thou hast subdued under me those that rose up against me.
40 Thou hast also given me the necks of mine enemies (oeyb);
that I might destroy them that hate me (sane).
C’. Triumph over enemies whose cry is unanswered
41 They cried (sawa), but there was none to save them:
even unto the LORD, but he answered them not.
42 Then did I beat them small as the dust before the wind:
I did cast them out as the dirt in the streets.
43 Thou hast delivered me from the strivings of the people;
and thou hast made me the head of the heathen:
a people whom I have not known shall serve me.
44 As soon as they hear of me, they shall obey me:
the strangers shall submit themselves unto me.
45 The strangers shall fade away,
and be afraid out of their close places.
B’. YHWH the Rock
46 The LORD liveth; and blessed be my ROCK (sur);
and let the God of my salvation be exalted.
47 It is God that avengeth me,
and subdueth the people under me.
48 He delivereth me (palat) from mine enemies:
yea, thou liftest me up above those that rise up against me:
thou hast delivered me (nasal) from the violent man.
49 Therefore will I give thanks unto thee, O LORD, among the heathen,
and sing praises unto thy name.
50 Great deliverance giveth he to his king;
and sheweth mercy to his anointed,
to David, and to his seed for evermore.