I understood the term "guardian of the peace" to be synonymous with the term "police officer." "Guardian of the peace" or "guardians of the peace" may have been used frequently in newspapers and magazines as alternative terms for "policeman" or "police officer." O. Henry says this policeman makes a fine picture of a guardian of the peace because of the description he gives of him in the first part of the sentence.
Trying doors as he went, twirling his club with many intricate and artful movements, turning now and then to cast his watchful eye down the pacific thoroughfare, the officer, with his stalwart form and slight swagger, made a fine picture of a guardian of the peace.
His "stalwart form and slight swagger" especially contribute to his "fine picture of a guardian of the peace."
What is most important in O. Henry's description of this particular police officer is that he wants to avoid any suggestion that this might be the man Bob is waiting for in the doorway of the hardware store. O. Henry is describing a typical New York uniformed cop. By the time this cop gets to Bob, the reader will have no suspicion that he is actually Jimmy Wells and that he has come there to meet his old friend. The reader is misled to believe that this is a beat cop who stops to talk to Bob because Bob looks a little suspicious standing in the darkened doorway of a closed store in a neighborhood where almost all the other stores are closed for the night. The fact that this guardian of the peace has been trying doorways all along the block to make sure they are properly locked contributes to the reader's impression that this is a typical cop who has no relationship with the man in the doorway.
As a matter of fact, Jimmy Wells really is a typical New York beat cop. He has obviously been a cop for years. O. Henry describes how he is "twirling his club with many intricate and artful movements" in order to suggest that he has had plenty of years to practice those intricate and artful movements. Jimmy would be forty years old now. He has probably been a cop for almost twenty years. Over time, he has settled into his role as a uniformed beat cop. It is evident in everything he does. Bob describes Jimmy as someone who would like a routine job.
He was a kind of plodder, though, good fellow as he was.
Jimmy's job is perfect for him, and the reader can tell he is happy with it. That would explain the way he plays with his police club and why he walks with a slight swagger. He is probably married, has several children and owns a modest house. He likely works in his garden and takes his family to church every Sunday. He is not wealthy or flashy like Bob, but he has peace of mind and security, whereas Bob will be going off to prison after years of being on the lam.