Aeroplane factory slang
The earliest example I can find of the phrase pre-dates World War II, in the April 1938 edition of American Speech (Vol. 13, No. 2, pp. 155-157) in a list of "Aeroplane Factory English" by Edwin R. Coulson:
EGG IN YOUR BEER. An easy job; something for nothing.
A footnote says this "trade dialect" was collected at the Douglas Factory, Santa Monica, California.
Army slang
The October 1941 edition of American Speech (vol XVI, no 3) carried a "Glossary of Army Slang", including:
EGG IN YOUR BEER. Too much of a good thing.
The earliest military use I found was by PFC. George H. Willers of the US Marine Corps in a letter to Life magazine (8th September 1941):
Just what the hell do they want — eggs in their beer? The undersigned, a marine, "goes out to sea in ships" and is only too glad to get ashore once a month or so, even though it may not be these blessed shores, to places where the beer is lukewarm, where ice cream comes from a cow by way of a powdered-milk can, and the food in restaurants looks like it has been eaten before.
The American Heritage Dictionary of Idioms says:
This expression dates from about 1940 and became widespread during World War II. The origin is unknown, since adding egg to beer does not improve the taste.
A December 1946 American Speech (vol XXI, no 4) includes 'Army Speech in the European Theater’ by Joseph W. Bishop, Jr.:
“Whaddya want—an egg in your beer?" Properly, this is the retort courteous to a gripe, or bitch, which is not fully justified. By loose usage, it has become an answer to any and all complaints. I do not know its etymology, but my assumption has always been that it is based on the fact that fresh eggs and real beer were two of the scarcest desiderata in the ETO [European Theater of Operations], the possession of one of which ought to have sufficed any man. There is some evidence that it has been prevalent around Brooklyn for years, but at any rate it has had wider currency in the Army than ever before and has been more apt.”
Dewdroppers, Waldos, and Slackers: A Decade-by-Decade Guide to the Vanishing Vocabulary of the Twentieth Century (2003) by Rosemarie Ostler lists it under the forties:
egg in your beer: too much of a good thing. What do you want, egg in your beer? was a common retort to pointless or unjustified complaining since in the wartime world either an egg or a glass of beer alone should have been a sufficient luxury for anybody.
The Facts on File dictionary of clichés suggests it could be an aphrodisiac, and mentions an 1883 recipe containing egg white and mead, but says these rare recipes are probably unrelated to the saying, and that it "is presumably viewed as some kind of enrichment".
Eric Partridge's A Dictionary of Catch Phrases (1986):
what do you (or, illiterately yet frequently, whaddya) want? eggs (or an egg) in your beer? 'Usually said to be someone who is bitching or griping without justifiable cause. I have heard this used only by Marines, but I strongly suspect that it was borrowed from civilian use' (Col. Moe 1975). Therefore, tentatively: C20; civilian become, during WW2, Marine Corps.
'I heard this first in 1937, (as ...egg...) and in a civilian context. Certainly it has been in general (not just USMC) use since then' (R.C., 1978). A shorter var. is you want an egg in your beer?; cf what do you want? Jam on it?
Real egg in real beer
A preview from a (probable 1915) Catering industry employee: Volume 24 reports on a Seattle court case on whether egg-in-beer is food or a drink:
And:
EC Maddox, another witness for the city, asserted he paid a nickel and received an egg in his beer. On the stand, in his own behalf, Aronson averred that egg-in-beer is one of the oldest combinations known to mixologists.
Von Ziemssen's Handbook of General Therapeutics (1885) lists "Warm beer with egg" and Practical Druggist and Pharmaceutical Review of Reviews lists "Root Beer with Egg".
The Archives of Pediatrics (1916) says with surprise:
Other foods recommended were French bread, hashed meats, and, last but not least, small beer with egg yolks beaten in ! ! !
A 19th century The Pet-Stock, Pigeon, and Poultry Bulletin says:
It is an old-fashioned recipe to clear warm beer with egg shells, and coffee with the yelk of an egg, and the clearing properties of the yelk of an egg seems to have been known to the Romans...
So, who's going to test it out and crack an egg into their beer this weekend?
I think it's a mixture of similes. He may have stitched you up, or he may equally have done you. In the latter case, he may have done you brown (like a piece of meat is well done) or done you like a kipper (even more so, since kippers are done, or smoked, for many hours). Combining the two is a jocular turn of phrase (like without a paddle to stand on) that is easily picked up by people looking for a strong or picturesque phrase without worrying much about its origins.
Edit: I notice (e.g. here) that done up like a kipper is also widely used. The problem with criminal argot of this era is "Minder", and the Godfather Effect; it is probably impossible now to disentangle which phrases were in use in the 70s/80s and picked up by the scriptwriters, and which were invented for effect by the scriptwriters, and picked up by the wide boys of South London or Essex.
Best Answer
It means roughly: "it is unlikely that I should be lucky enough for this to happen, but if it did I would be great."
See Wiktionary.
--- UPDATE ---
As a follow up to why it means that, here is my speculation. It is a simple figure of speech that over time has formed into an idiom. In this case "chance" is used by metonymy to mean the results of chance. The literal meaning would be "If the unlikely event happens". Here an aspect of the event -- its low probability -- is used by metonymy for the event as a whole. If you remove the figure of speech the expression would be "[If] the unlikely event happens, [it] would be a fine thing." The "unlikely event happens" is replaced by metonymy with the word "chance", and we get the original.
After this substitution there are various elements and baggage that attach to the phrase over time to give it the current color of meaning, specifically the strong pessimistic tone, and various ellipses to make the saying pithy.