if you do want something and having it requires no effort whatsoever
I just can't wrap my brain around why this would apply. The very existence of a shop or other such physical location creates effort where there is none in the default case of having everything at home, within reach from your comfy chair. The discrepancy is
massive for a person used to the fact that he doesn't need to leave that comfy chair, like, ever.
Worse still, if there's a salesperson involved, another chasm emerges, that between this total stranger and the machine you have already configured to your most detailed personal specs.
No, the mystery here isn't why everybody in the universe doesn't go to Garak's. The mystery lies in why anybody would ever get up from that comfy chair. (Of course, that doesn't apply in this specific case, because the individuals aboard DS9 are either lunatics who agree to working for Starfleet or other interstellar organizations, or Bajorans who don't know better. But it ought to apply elsewhere.)
Could a replicator reproduce programming code that it "knew" nothing about? Can it scan programming?
Inevitably, yes.
After all, the programming is in there, physically built into the original phone the replicator is asked to duplicate. If it weren't there physically, it wouldn't exist, and the original phone wouldn't work.
Sure, it's a subtle sort of physical. But it's not magic. It's all down to where this atom and that electron are located, and how they are moving. And duplicating that is the bread and butter of replication, even literally so.
The same is obviously necessarily true of the human intellect. We just lack the replicators to demonstrate this in practice.
(If there really is some sort of magic involved, we already know the replicator has that covered, too - it could duplicate the functionality of the alien device in DS9 "Rivals", despite everybody agreeing it was nothing short of magical.)
Timo Saloniemi