Sampson did not have magical hair. In verse 22 it is noted that while he was in prison his hair begin to grow long again. But even as his hair grew, his strength did not. When the Philistines assembled to offer a sacrifice to Dagon their god, they gave Dagon credit for the capture of Sampson. They had brought Sampson out to mock him, and to mock his God. Sampson once again had hair, that he did not have his strength. Sampson was cheap entertainment; he performed for them, and his performance was not acts of mighty strength.
As he stood between the pillars that supported the temple, Sampson prayed. He asked God to remember him, to strengthen him. Sampson wanted his final actions to end in revenge and suicide. God answered his prayer. The supporting pillars of the temple were pushed out and the Philistines, along with their rulers, were killed as Sampson died.
The text does not tell us that Sampson prayed a prayer of repentance. We cannot know his heart completely, but we do know he was driven by the desire for personal revenge. I do not believe God strengthened him so he could get his revenge. In truth, the Bible teaches that vengeance is not supposed to be ours, but we are to give the debts that others owe us to the Lord and trust him to do what is right.
I do not believe God strengthened him so he might commit suicide. God tells us life is precious and it seemed contrary to that teaching to believe that in this case God endorsed suicide. God did not strengthen him to deliver Israel. We know this because Sampson’s final action did not result in Israel’s deliverance.
God did have a reason for giving Sampson back his strength. He wanted Israel, the Philistines and us today to know this truth. “The presence of the Holy Spirit makes even a malnourished, abused and blind slave more powerful than even the most powerful false God.”