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 the troubles which satan throws at us with faith, 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.
 
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.
 
vv 8-10a tell how David prayed. This is a great prayer. We should all realize that we are a profit for the Lord and that He will suffer loss if we die.
 
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).
I think there is a time gap of some years between 1Chron 21:28, when David sacrificed at the threshing floor of Ornan, and 22:1, when David dedicated the location of the house of God, when this psalm takes place. This is indicated by 1Chron 21:29-30, which seem to be for a period of time. Also 1Chron 21:29 starts in Hebrew with "and <noun>", which indicates a time break in the narrative.
 
12 I think there was a tendency to be silent because of all the lives that were lost due to David's error.