Psalm 30 - In my ease, I said, I shall never be moved.
 This psalm is another of my favorites. I think it is the best pattern of repenting and coming back to the Lord as our 1st love.

Verse 5 in this psalm is one of my all time favorite verses. Also vv 6-7 are favorites as a warning.

I used to think that this was a joyful, celebrating psalm, mainly because I was just familiar with verses 4-5, 11 & 12.
The Psalm Title refers to David's dedication of the threshing floor of Ornan the Jebusite as the site for the Temple (1 Chron 22:1; 2 Sam 24:18,25). To appreciate this psalm, you need to be familiar with David's grave mistake in numbering the people and the consequences as recorded  in 2 Sam. 24 & 1 Chron 21.

KJV wrongly translates the title of this psalm as "at the dedication of the house of David."  This is wrong based both on the content of the psalm and on the Hebrew in the psalm title.

Psalm 30 is about a specific event in which David gravely erred due to the ease of his life (v6-7). (2 Sam 24:1; 1 Chron 21:1).
Jehovah hid His face from David, and David got in trouble. (v7)
David was very close to death. (v 2,9). (1 Chron. 21:16,30; 2 Sam. 24:17)
The anger of Jehovah was kindled against David and Israel. (v5) (2 Sam. 24:1; 1 Chron 27:24;21:7)
David made supplication to Jehovah. (v8) (2 Sam. 24:10; 1 Chron. 21:8)
Jehovah's wrath lasted a short time. (v5). (2 Sam 24:13,15; 1 Chron 21:12,15)
David was clothed in sackcloth. (v11). (1 Chron. 21:16)
David said "This is the house of Jehovah" regarding Ornan's threshing floor. (1 Chron 22:1. Psalm 30 title.)

Furthermore, the 2 Hebrew words that KJV translated as "house of David" are "ha-beth le-David". The phrase "house of <name>" is very common in the Old Testament, and it never uses the preposition "le" in front of <name>. To say "house of David", the Hebrew should say "beth David", not "ha-beth le-David".  "le-David" is the way of showing Psalm authorship.  
vv.1-3 are David's praise to the Lord for restoring him. The Lord drew him up, did not let his enemies rejoice over him, healed him, brought him up from the dead, and made him alive.
v1 - For the Lord to draw us up is for Him to restore us to our proper stand. The Hebrew word is used for drawing water up out of a well. This usually is through a suffering or loss that we thought would never happen to us. There is a natural tendency for us to fall from our God-ordained simplicity in Christ, and yet to think that we have advanced (1 Cor. 10:12).
To stand in having the Lord as our 1st love, we need to practice Eph. 6:11-18, to be restricted by the truth & a good conscience. We need to stand upon the gospel of peace, that is what the Lord did for us, and not upon any special doctrine or practice. Then, with these 3 as a base, we take up the shield of faith. The shield of faith surrounds us in all directions. When we meet with faith the troubles which satan throws at us, the troubles strengthen our faith. Most importantly, we need to enjoy the Word of God constantly, staying very close to Word, using it to pray to the Lord specific things for all the saints all the time. The Word then becomes our helmet of salvation and the sword of the spirit, to slay the thoughts that would have us depart from the Lord. Commentaries on the Word are not a substitute for the Word itself.
We are in a war against spiritual wickedness in the heavens, and those forces rejoice to see us individually, and the local church we serve to be defeated.
v2 - The Lord's healing of us and the local church is for us to bear fruit and give life. (Gen. 20:17; 2 Kg 2:21; 2 Chron 7:14; Isa 6:10; 30:26; 53:5; Jer 3:22; 6:14; 8:11; Ezek 47:8,9,11; Hos 14:4) The Lord's healing of a church is pictured by the healing of a house from leprosy (Lev. 14:48).
v3 - David saw the angel of death with his sword raised over Jerusalem. He prayed, Lord, let this be on me and on my family instead of on Your people. He thought he was as good as dead. (1 Chron. 21:16,30; 2 Sam. 24:17)
vv 4-5 are David's encouragement to God's people based on his experience which follows.
lit. Give thanks for the remembrance of His holiness.
When I remember God's holiness, it gives me a healthy holy fear, reminding me that I need to be not only good, but holy.
We should give thanks when we remember His holiness, because forgetting His holiness could result in His wrath for a moment in the next verse.
vv 6-12 recount what happened.

vv 6-7 tell the trouble. The same will happen to us if we think we know the way to be an overcomer, and become independent of the daily leading of the Lord.
7 God hiding His face from David is similar to the time that God left Hezekiah (2Chron 32:31).
vv 8-10a tell how David prayed. This is a great prayer. We should all realize that we are a profit for the Lord.
Our profit to the Lord is in praising Him from heartfelt realization of Him and in declaring His truth to others.

David's praise is throughout this Psalm in vv 1, 11-12.
David declares the Lord's truth in vv 4-5.
vv 10b-12 are the result.

v11 - The word "dancing" seems inappropriate for the severity of the consequence of David's sin in 2Sam 24 and 1Chron 21. 70,000 people died (2Sam 24:15).
But there could be dancing after the time of mourning was finished as there was after the covid plague.
12 I think there was a tendency to be silent because of all the lives that were lost due to David's error.