The term "wag" is normally seen in contemporary speech as a verb, as in the phrase "the dog wagged its tail." When used as a noun, the word has a second meaning that was current in the sixteenth century, and continued to appear in literary contexts through the twentieth, albeit more commonly in British than American English. The term "wag" is used to refer to someone with a droll or mischievous sense of humor. In Shakespeare's "Henry the Fourth Part 1," for example, Falstaff, very much a wag himself, repeatedly addresses Henry as "wag" or "sweet wag" (II.1).
The particular phrase appears in Chapter 2:
The eyes of Doctor T. J. Eckleburg are blue and gigantic-their irises are one yard high. They look out of no face, but, instead, from a pair of enormous yellow spectacles which pass over a nonexistent nose. Evidently some wild wag of an oculist set them there to fatten his practice in the borough of Queens, and then sank down himself into eternal blindness, or forgot them and moved away.
This paragraph describes a colorful billboard consisting of a picture of glasses and eyes, not attached to a face, but appearing to float in a disembodied fashion over the highway against a drab landscape. Because the narrator considers them bizarre and funny, he presumes the oculist was a "wag".
The phrase "wild wag of" means someone who plays extravagant jokes on others. In Chapter 2 of The Great Gatsby, Fitzgerald writes that "some wild wag of an oculist" put up the poster of Doctor T.J. Eckleburg with huge blue eyes to benefit his business in Queens, New York. The oculist, or eye doctor, then forgot about the sign or might have "sank down himself into eternal blindness." The fact that the oculist put up the sign as a kind of joke, though one that is good for business, is significant. It almost implies that the divine presence is humorous, as Eckleburg seems almost divine and all-knowing in the way he peers, with his enormous eyes, out over the landscape. Only Eckleburg sees all, and the characters in Gatsby, each with his or her own limitations, do not. Only Eckleburg, initially installed by a "wild wag," an alliterative way of saying a jokester, seems to know everything that happens around him.