Flexible word order
The difference is only that the words are in a different order. The grammar is the same. English actually has somewhat flexible word order, though we rarely exploit this in everyday conversation or prose.
The normal word order in English is SVO: subject-verb-object. That's the order of “John came along.” (There’s no object in that sentence; along is a particle, part of the phrasal verb “to come along”.)
But you can rearrange the words in many sentences and still make grammatical sense. One way to do that is to put the subject right after the verb, as in “Along came John.” There are other ways, too.
Here are some more examples, all of them famous:
Able was I, ere I saw Elba. (A famous palindrome.)
= “I was able ere [before] I saw Elba.” (Meaning: I, Napoleon, had power before I was exiled to the island of Elba.)
He called for his pipe, and he called for his bowl, and he called for his fiddlers three.
(From Old King Cole, a nursery rhyme.)
= “…and he called for his three fiddlers.” The purpose of putting the adjective after the noun is to rhyme with an earlier line in the poem, which also has unusual word order.
We three kings of Orient are. (Christmas carol, John Henry Hopkins, 1820–1891.)
= “We are three kings of Orient.” (That is, we are three kings from the East.)
My mind to me a kingdom is. (Sir Edward Dyer, 1543–1607.)
= “To me, my mind is a kingdom.”
As you can see from the examples above, one use of unusual word order is to fit the constraints of poetry or word-play.
More often, unusual word order indicates that something is special or important, thus deserving the emphasis and attention that comes from using words in an unexpected way. When someone says “Along came John”, they mean that John came along unexpectedly, and this was a wonderful or perhaps terrible event.
For example (not famous; I'm just making this up now):
In the orchestra pit holding a baton stood my son.
= “My son stood holding a baton in the orchestra pit.” A parent might use reversed word order to proudly describe seeing their son conducting an orchestra for the first time. The ordinary word order feels too dull and prosaic to describe such a momentous event.
This example illustrates another important use of unusual word ordering: to put the words in the order in which you want the listener to think about or imagine their meanings, when this is not the same as the normal order. The sentence above leads the listener to first imagine an orchestra pit, then some unidentified person holding a baton (therefore the conductor), and finally it is revealed that the conductor is the speaker’s son.
Often, a word gets strongest emphasis by appearing last, especially if it’s a noun. Mentioning the son last emphasizes the son, and mentioning John last emphasizes John.
Finally, unusual word ordering can sometimes create nice rhythms. The sentence about “my son” has a pleasing rhythm: it contains three “feet” of equal duration, each starting and ending with a stressed syllable: “orchestra pit”, “holding a baton”, “stood my son”. The prosaic version has a disorganized rhythm, like most prose. Ending on a stressed syllable often gives a sentence extra “punch”.
It takes “an ear for the language” to know when you can say words out of order and still be understood, and to predict what kind of poetic effect it will have. Part of the way you develop an ear for the language is by becoming familiar with well-known examples of unusual word order and poetic expression. They not only make you familiar with ways to “stretch” the language, they’re phrases that you can expect most English speakers to have heard, so your own unusual phrasings will echo the familiar ones in listener’s minds, helping them to follow the syntax.