What Silvio and Paulie represent on the show
They are the archetypes against which Tony judges himself. Silvio is the gangster Tony hopes he is. Paulie is the gangster he's afraid he might be. Over the series, neither gets much character development. They're basically a skewed version of the angel and the devil on Tony's shoulder. It's more like two devils since deep down Tony has no illusions that he's the "good guy". He's just concerned about what kind of villain he is.
is wise, stoic and reserved, the epitome of the Strong Silent Type Tony so admires, and when he's angry it's genuinely frightening. At one point, Silvio mentions offhandedly that he once sought therapy, like it's no big deal. That's how Tony wants to see it. No stigmata, he just needed to assemble some better coping mechanisms. Tony's archetype of the "perfect gangster" is reinforced by the fact that the actor playing Silvio is a rock star. Even his name, "Silvio Dante". This is the side of the Sopranos that hooked so many viewers. It's just undeniably cool.
On the flipside we have "Paulie Walnuts
", who embodies the absurdity of the show that ultimately keeps people watching. Every time a group of fat gangsters stand around and make amusingly ignorant comments, every time a criminal venture goes awry in dark, comically detached fashion, that's Paulie. And although Tony likes to see himself as above this, there are many scenes in which he loses his shit over something petty and irrelevant. This guy is a cartoon character, totally unsympathetic but bumbling enough to entertain, all without ever really seeming too threatening (one of his few kills was an old woman he smothered with a pillow. Note the parallels to Tony's attempted smothering of his own mother, which was regarded with disgust). Tony's afraid that while trying to attain the Silvio standard, he will go wrong somewhere and turn into Paulie.
The ending of the show, with Silvio comatose (Note how he survived getting shot up
) and Paulie alive and well, could indicate one of two things. Either Silvio is gone because Tony has achieved his lifelong dream of inhabiting the role of the Perfect Gangster and no longer needs to externalize it, or because that side of him is gone, leaving only a hollow cartoon shell, at which point nobody would want to continue watching.
This is not a WMG that they are figments of Tony's imagination. The Sopranos was, as a whole, a fictional character study. These two served as parallel foils to the protagonist.