The role of Bilbo's sword in this excellent novel can actually be related to the development of Bilbo as a character as the novel progresses, in particular when Bilbo gives his sword its name. Let us remember that Bilbo first finds his sword in Chapter Two, in the treasure trove of the trolls that Gandalf manages to trick and turn into stone. Note how the sword is described:
...Bilbo took a knife in a leather sheath. It would have made only a tiny pocket-knife for a troll, but it was as good as a short sword for the hobbit.
What is crucial to note is that at this stage Bilbo does not name his blade, and it is only mentioned as a passing comment. However, if we jump forward to Chapter Eight and when Bilbo rescues the dwarves from the spiders, we can see how using his sword successfully and killing a spider is a key part of Bilbo's character development:
Somehow the killing of the giant spider, all alone by himself in the dark without the help of the wizard or the dwarves or of anyone else, made a big difference to Mr. Baggins. He felt a different person, and much fiercer and bolder in spite of an empty stomch...
The use of the blade coincides with Bilbo's transformation from a food-loving hobbit to an adventurer, and it is highly significant that this transformation also is marked by Bilbo naming his blade Sting, which cements the transformation. Thus we can see that Sting is an important marker of Bilbo's own journey towards being a hero.