According to George Mason University's History News Network, the first recorded use of OMG! surpasses MySpace and goes as far back as 1917. As David Silbey explains:
In a quite lovely bit of sleuthing, the Oxford English Dictionary has discovered a use of "OMG" from 1917. It comes in a letter by British Admiral John "Jacky" Fisher, who wrote that:
I hear that a new order of Knighthood is on the tapis -- O.M.G. (Oh! My God!) -- Shower it on the Admiralty!
The letter was published in his Memories, published in 1919.
Fisher was famous for being the driving force behind the creation of the HMS Dreadnought, an advanced capital ship which, when it was launched in 1906, seemed revolutionary. This, the world navies agreed, made all other capital ships obsolete, but, distressingly to the British, destroyed their long-standing lead in naval power, if temporarily. The result was an enormously expensive Anglo-German naval race, which did much to bring on World War I.