Before he even meets Gollum, Bilbo has already shown himself to be brave, resilient and capable of taking initiative. When Chapter 5 begins, Bilbo wakes up in the dark, disoriented and alone. He has been dropped and left behind in the goblin tunnels. Though scared, he manages not to panic. He draws his little sword, finds that it glows in the dark, and decides that to "go forward" is the "only thing to do."
It is under these circumstances that he steps into the edge of Gollum's lake, which, as far as Bilbo is concerned, is the end of his road. Now he really has no idea what to do. It is then that Gollum approaches him and starts speaking to him.
Bilbo draws his sword, which shows that he is prepared (if not very well-equipped) to defend himself. Gollum, nervous of the sword and curious about Bilbo, suggests they sit and tell riddles. Bilbo, the author tells us, is
anxious to agree, until he found out more about the creature, whether he was quite alone, whether he was fierce or hungry, and whether he was a friend of the goblins.
Here we see Bilbo's adaptability. He is willing to sit in the dark and talk with a strange creature, if it seems like that is called for. We also see his savvy, or cautiousness. He is aware of possible danger, aware of the many things he does not know, and wishes to survey the situation before acting. Finally, we see his basic civility. He does not immediately attack Gollum with the sword. His default is to try to get himself out of trouble with words rather than with violence.
During the riddle competition, Bilbo shows that he has a wealth of traditional knowledge, as well as the ability to keep cool and think clearly in a very scary situation. When he wins, he again shows his savvy by not assuming that Gollum will show him the way out (as agreed) rather than attack him. This savvy comes in handy a few minutes later when Gollum does come after him to attack him, having guessed that Bilbo has his ring.
Bilbo flees up the tunnel, accidentally puts on the ring, and falls flat on his face, invisible. Gollum goes right past him. Bilbo, without fully understanding what has happened, makes the gutsy decision to follow Gollum. This again shows Bilbo's ability to take a risk when it seems like the best solution. As he follows Gollum, he uses the skill, a trait of hobbits, of being able to move absolutely silently.
Gollum talks to himself about what might happen now that Bilbo has the ring. From listening to Gollum's talk, Bilbo is able to piece together that the ring is Gollum's and that it makes people invisible, and also that Gollum is, without meaning to, showing Bilbo the way out.
Finally, Gollum comes to the goblins' "back door" and decides to wait at the entrance to the tunnel that will lead out. This means that Bilbo is trapped. Gollum is blocking the way. Even invisible, Bilbo cannot squeeze past him, and if he waits long enough, Gollum is likely to hear or smell him.
Bilbo considers killing Gollum, but he is stopped by his sense of fair play. "No" (he thinks), "not a fair fight. He was invisible now. Gollum had no sword. Gollum had not actually threatened to kill him, or tried yet. And he was miserable, alone, lost." At this moment, Bilbo experiences insight into what Gollum's life must be like, and feels pity for him. He does not kill Gollum, but leaps over him. Besides showing some athletic skill, the leap also shows the ability to take action in a crisis situation, rather than sitting frozen.
Luck played a key role at several moments in Bilbo's adventure with Gollum. He could not have survived without luck. But he also could not have survived without the skills and traits which are highlighted above.