The earliest match for the phrase that a Google Books search finds is more than a century old. From Eden Phillpotts, "Quite Out of the Common," in Punch (April 11, 1900):
There followed no immediate response; then three boys assembled under my arch, and they formed a nucleus or focus about which a small crowd of the roughest possible persons, male and female, collected. Last of- all a policeman came also.
"Now then!" he said, "what's all this, then?"
The miserable boys took entire credit to themselves for discovering me perched aloft. They pointed me out and called attention to the Jubbulpore rope dangling from the lamp, and elaborated their own theories.
Very properly the constable paid no attention to them, but addressed all his remarks to me.
"You up there," he asked, "what d'you think you're plyin' at?"
So in 1900 we already have "what's all this, then?" presented as a typical query that a London policeman of modest education might pose to a small crowd that has gathered for no immediately discernible purpose.
I imagine that it originated as a variant of a predictably common constabulary question along the lines of "What's all this commotion [or disturbance or excitement] about?" but I haven't attempted to find historical antecedents of the specific wording that the poster asks about.