No, I don't see any vanity at all. Well, not of that kind. He felt an overwhelming desire NOT to go on the quest. He referred to it as a "hopeless journey" to Pippin, quite openly. He saw it as a kind of long-awaited doom that he hoped he might not have to suffer. He wanted the cup to pass, but it didn't, and no-one offered an alternative.
He broke down and wept in despair that his quest would be 'in vain' not long before Shelob's Lair. He must have known, increasingly, that he couldn't destroy the Ring. He was even seriously worried he wouldn't get to Mount Doom in the first place. But the Wise were intent upon sending him to Mount Doom anyway. He wasn't going to defy the wisest people in Middle-earth ... but also, Gandalf had said "I will always help you. I will help you bear this burden, as long as it is yours to bear." So even though Gandalf had not at that point mentioned accompanying him, I think he expected more guidance along the way. Don't forget that he was willing to lean on the guidance of Gandalf and Aragorn, and did not expect to lose them ... it says that partly because of this, he spent as much of his time in Rivendell as possible with Bilbo. The Fellowship members are not finally decided until a week before they set out, but Gandalf has said he thinks he will go.
Regarding going through Moria, Frodo says "I do not wish to go. But neither do I wish to refuse the advice of Gandalf." He had a deep trust in Gandalf, as did Sam. As long as he was around, somehow the impossible seemed possible, perhaps?
My gut feeling has always been that Frodo was completely honest and very sincere. His refusal to destroy the Ring knocked me for six when I was 12, and I remained knocked for six for many years. But eventually I completely accepted - on a gut level, and not just because Tolkien had said so - that asking him to resist the Ring at Mount Doom was asking the impossible.
Obviously for him to
destroy it was impossible anyway - we saw that at the hearth at Bag End. But *resist* it - resist claiming it - he did. Until the very last. I disagree with Tolkien's choice of pronoun over this. He says in one letter 'He did not endure to the end.' I believe he *did* endure to the end. It was *at* the end that he couldn't endure/resist any more.
Frodo having ulterior motives - I mean seriously, evil motives in bearing the Ring - can work hilariously in parody, I have found.

But nowhere else.