One doesn't get to be first officer suffering an "inferiority complex". The ships he was offered were not nearly as impressive as the Enterprise-D. It's analogous to deciding not to pursue being a start-up entrepreneur over being a senior executive in a large, publicly-held corporation. He may also have been motivated to remain in a posting near Troi
Let's also not forget that the Enterprise-D isn't just ANY ship exactly. She was the ship with a LOT of history. THE Federation FLAGSHIP for a VERY specific reason. One doesn't just get to be first officer of the Enterprise. You have to have a LOT of very impressive skill to be posted to that ship. Sure the Melbourne MIGHT have been a Nebula class (I read somewhere that the specific ship Riker was to take command of in BoBW was a Nebula class in fact), and those ships were just as powerful, maybe even a little bit more than the Galaxy class (of which in particular the Enterprise is a part of), but the Enterprise has had a history that not only stretches as far back as Kirk and Archer, but even farther to the 16th century and even farther than that. Maybe he was hoping that Captain Picard would've taken the promotion at Starfleet Academy and left him in command. Sorry, no such luck Riker ;) Besides, as he was quoted as saying, "there are officers who wait YEARS to be posted to that ship."