My guess would be that this usage derives from the more traditional usage of "to go" with the meaning "To make a specified type of sound or noise, as to go bang, to go clatter, to go crash, etc." (OED). The Oxford English Dictionary records this usage as having first appeared in 1583: "Then snap go the fingers, ful brauely god wot." (Later examples: "Her pulses went pit a pat-pit" from 1604; "slap goes a Door, clatter goes a Key" from 1710.) It's quite common in children's books to see this usage: "The bell goes dong!" "The cow goes moo!" etc.
According to the OED, the use of "to go" for describing human speech dates back to the early 1800s. "Of a person: to utter a specified sound or noise. Later also used to report direct speech: to say, utter. Frequently in the historic present."
The first example of this usage given in the OED is from Charles Dickens' "Pickwick Papers" (1837): "He was roused by a loud shouting of the post-boy on the leader. ‘Yo-yo-yo-yo-yoe,’ went the first boy. ‘Yo-yo-yo-yoe!’ went the second."
Based on the examples the OED gives, it does sound like the usage for reporting direct speech probably arises around the 1960s, as Matty Sue says. The earliest two examples of direct reported speech that the OED records are these:
So she goes, Oh yeah. So I goes, Well, there you are then. (1967 E. Marvin Odds Against iv. 49)
So the cop stops us... Then he goes, ‘Were you drinking or something?’ And I go, ‘No, I don't drink,’ and he goes, ‘Okay.’ (1970 R. Thorp & R. Blake Music of their Laughter 19/2)