The Kamarna Rebbe zy”a explains this Medrash differently.
He quotes Rav Yitzchok of Drohvitch zy”a (the father of the Magid of Zlotchov zy”a) as saying, “When I want to travel to certain cities to help Yidden improve their avodas Hashem, the Satan comes to me and asks, ‘Why are you traveling? Don’t you know that moving around from place to place will negatively affect your learning and davening?’
“I tell him, ‘Don’t worry. I’m just going to collect money.’
“He then says, ‘That’s okay. I let you do that.’
“But when I get to those cities, I spend my time chastising Yidden for their aveiros and persuading them to do teshuva. I totally forget about raising money and I do the mitzvah I am focused on.”
Accordingly, the pasuk begins: If you will walk in My ways and keep and do them.” One may ask how he can accept to walk in the ways of the Torah if the yeitzer hara is constantly trying to obstruct him. To answer this question, the pasuk continues: “And I will give your rains (gashmichem) in their time.” This can be understood to mean that one should tell the yeitzer hara that he is not doing mitzvos l’shma; rather, he is doing them for gashmius reason – as a merit for wealth and honor. Therefore, the yeitzer hara will leave him alone and he will be able to serve Hashem l’shma.
The Medrash is saying that Dovid would counter the yeitzer hara’s attempts to stop him from going out in the early morning to daven, learn and do mitzvos by saying that he was going out for business reasons. But once he got the yeitzer hara off his back, he would forget about his business and hurry to the bais medrash.
