I think by Season 4, had Riker left after BOBW for a command of his own, Data should have been next up as Picard's Number One. Worf as depicted in TNG, while a good officer, was never qualified to be second in command of the Enterprise.
See, I liked the character of Riker, and Frakes, but I also agree that it never made sense after BOBW, for Riker to turn down a Captaincy, especially after he already WAS promoted to captain, once Picard was captured. In essence, Riker helps save Earth and gets DEMOTED for his trouble.
There's a difference between assuming the position as the next in line on the ship and having the rank to hold it long-term. Data may not have qualified for the promotion to Commander and permanent first officer at that point, in Starfleet's eyes. And somebody correct me if I'm wrong, but I don't think that Riker got an actual rank promotion in BOBW...he just assumed command of the Enterprise as the highest ranking officer onboard.
The commander of a starship is called "Captain" even if they don't hold the actual rank.