I'm partial to the shift key+z typo answer.
If you're typing OMG really fast (cause you're so excited) you're going to slip and hit zOMG, since the < key isn't between shift and Z on most US keyboards.
Outside of any of the other possible origins, the typo is the most likely because it's most easily 'discovered' by small groups of people who are instant messaging each other. Most likely it has risen out of a parallell evolution because of our natural tendencies (as opposed to being invented or "first coined" by anyone).
Essentially, we all invent it ourselves.
Tom Wolfe wrote an excellent book about the origins of the space program, which was made into a movie, The Right Stuff. If you read the wiki entry on the movie, you'll learn more.
Early competition between test pilots (true heroes) and the first astronauts was intense, with each trying to prove they were braver than the other. Cowardice or loosing control due to fear was nicknamed screwing the pooch.
Gus Grissom always wanted to be a pilot. He flew over 100 difficult combat missions in an F-86 in Korea, became a test pilot, and was chosen by Nasa as one of the seven original Mercury Astronauts in 1959. Astronauts were confined alone to a tiny Mercury capsule, with a small round window, and a lot to do manually. The pressure was great on them.
Gus's first space flight was somewhat less than a complete success. Upon splashdown in the Atlantic Ocean, the 70 explosive bolts which held the hatch in place inexplicably exploded prematurely, forcing Gus to evacuate the capsule and swim while the rescue helicopter frantically tried to save the capsule from sinking. It was not successful, and Gus nearly drowned while the capsule (which contained a lot of information) sank to the bottom of the ocean, never to be recovered.
Although his fellow astronauts supported him in every way, and a NASA inquiry led to the eventual conclusion that the explosive hatch blew of its own accord, Gus never recovered his stature with the public or the media.
Gus went to his grave unflaggingly insisting that he did not screw the pooch, which was test pilot jargon for submitting to panic. "I didn't do anything. I was just lying there and it just blew, said Grissom." However, the media painted him as a failure, a coward who panicked and blew the hatch in an attack of claustrophobia.
"The phrase screw the pooch itself was derived from an earlier
phrase that was quite familiar to those of us in the service in WW2. I was a Fire Control Computer technician (Fire Controlman) in the US Navy 1944-1946.
"Anyone who has ever been in the military has spent an inordinate
amount of time in a 'stand-by' formation waiting for someone to get
the orders to start some activity. Many man-hours were spent in an
activity that was commonly known as 'Effing the dog.' Back
home in civilian life this was cleaned up to the slightly more
acceptable 'screwing the pooch."
Best Answer
In complement to Kosmonaut's answer, I'd like to add a few pieces to the jigsaw puzzle.
The undisputed etymology of the English noun screw is from Middle French "escroe" (pronounced "escrow") which evolved into present-day French "écrou" (pronounced a-crew) and designates the nut (of a bolt). Its use in English is recorded as early as ca 1400.
Interestingly enough there are in present-day French a number of expressions related to the jail system bearing the word "écrou".
From there one is faced with two different and possibly complementary explanations because the Old French word escroe has two different meanings, each with its own etymology.
The first (ca 1160) meaning of the Old French word escroe is that of a scroll to which new strips (called escroeles) of parchment where appended when more room was needed. From this meaning comes the posterior English words scroll and escrow. This meaning in turn evolved to also designate various royal administration registers (for instance "écroues des dépenses du Roy"). Another of these registers was used to keep track of the imprisonments and releases of prisoners. Hence the "registre d'écrou" and the word "écrouer".
Oddly enough the second meaning (16th century) of the Old French word escroe is that of the common screw. Although the etymology is still disputed, the most convincing theory is that of an analogy with the genitals of the swine and the boar (the penis of a boar is shaped like a cork-screw and the swine cervix matches that shape). The Latin word for a breeding swine is scrofa 1, 2.
So how does the screw relate to a key?
First one has to take into account the fact that many prisoners were not only locked in cells (either individual or collective) but also shackled and chained to the wall (in older times when locks were expensive to produce, they were just chained) and that involved shackle riveting and later screwing (for screw pin shackles). There are a number of collectors shackles that can illustrate this "technology" - here is a randomly selected sample (of which I include the pictures below in case it goes away). One can guess how it works: the screw must first be removed so that the key can open the shackles.
Note 1: In Icelandic the word for screw is skrúfa (very close to the Latin scrofa) and incidentally also means "to mount a female". In Spanish, the screw nut is tuerca whilst the swine is puerca. Note 2: See also the etymology of porcelain for another word involving the swine genitals.