It most certainly wasn't a piece of fan fiction. Too many important details were sorted out that a piece of fanwank would fail to address — most notably why have the Decepticons returned to Earth, and how are the humans from the first film still integral to the story. Additionally, whomever wrote that treatment had a very strong understanding of the themes and subplots of the first film, taking the opportunity of the sequel to develop them even further. Lastly, the treatment brought several original ideas to the Transformers lore; fanwank generally just rehashes that which has come before.
The treatment they decide to use in the end it may not be, but a treatment by a Hollywood writer(s) it most certainly was.