Bilbo isn't talking to himself at this point, as the context makes clear:
Elrond went forward and stood beside the silent figure. ‘Awake, little
master!’ he said, with a smile. Then, turning to Frodo, he beckoned to him. ‘Now at last the hour has come that you have wished for, Frodo,’ he said. ‘Here is a friend that you have long missed.’
The dark figure raised its head and uncovered its face. ‘Bilbo!’ cried Frodo with sudden recognition, and he sprang forward.
‘What were you doing?’ [Frodo asked]
‘Why, sitting and thinking. I do a lot of that nowadays, and this is the best
place to do it in, as a rule. Wake up, indeed!’ he said, cocking an eye at Elrond. There was a bright twinkle in it and no sign of sleepiness that Frodo could see. ‘Wake up! I was not asleep, Master Elrond. (...)
The first two sentences he speaks are directed to Frodo, who had asked what he was doing before the company entered the Hall of Fire. The words that followed are addressed to Elrond, who had asked him to wake up. "Wake up" repeats Elrond's words; the addition of "indeed" roughly means "as if I needed to be woken up from sleep" (since Bilbo wasn't actually asleep, whereas he had often seen Frodo asleep).