Sasori's reason for staring at Ōnoki for so long was simple. His Dust Release was excellent, powerful, and intimidating. Sasori wanted it!
As for how to obtain Dust Release-
Sasori planned to wait until the leader killed Ōnoki, then collect his corpse and turn his body into a Human Puppet far superior to the Third Kazekage!
A Human Puppet that could use Dust Release!
With Konan's orders given, Kakuzu and Sasori naturally had no intention of slacking off any longer. They turned their attention toward the Iwagakure ninja being led in a steady retreat.
The aftermath of Ōnoki and Pain's battle had left the ground covered in scorched marks from Dust Release's disintegration and enormous craters blasted out by Shinra Tensei. That was precisely why Ōnoki had insisted that Kitsuchi lead the Iwagakure ninja in retreat.
As for Deidara, who had joined the battle, he had overestimated himself somewhat.
He could only watch the battle between Ōnoki and Pain, occasionally throwing his Clay Bombs in an attempt to help Ōnoki. But almost all those Clay Bombs were detonated before they could even touch Pain.
During that time, Ōnoki launched two more Dust Release attacks, but Deva Path Pain precisely deflected each one with Shinra Tensei.
His breathing grew heavier and heavier, his body increasingly stiff. Even his back was soaked with sweat.
"Old man, where the hell did this guy come from? How is he this strong-"
Deidara stood back-to-back with Ōnoki. He did serve a purpose, at least: whenever that strange gravitational pull took hold of Ōnoki, Deidara's Clay Bombs forced Deva Path Pain to break off and dodge.
It wasn't as though Pain hadn't considered killing Deidara outright. But whenever Pain focused his attention on Deidara, the threat Ōnoki posed kept rising.
"They're just a bunch of lunatics!"