The usual sentence order would be: "A small unregarded yellow sun lies far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy." This version has the usual Subject followed by Pedicate (verb) format. What Adams has done here is postpone the Subject to the end (this in linguistics is called fronting: a technique writers employ mostly for the purpose of emphasis.)
Fronting is a type of focus strategy often used to enhance cohesion and provide emphasis. When used in conversation, fronting allows the speaker to place attention at the beginning of a sentence to make a story more compelling.
Fronting has a variety of functions in discourse, especially in the maintenance of cohesion. It can be used to organize the flow of information in a text, express contrast, and give emphasis to particular elements. In particular, fronting serves as a device to to make non-subject elements the theme of a sentence.
Pearce, Michael. The Routledge Dictionary of English Language Studies. Routledge, 2007.
Fronting can also trigger something called inverted subject-verb order. By moving the subject out of its natural environment, it involves a shift of emphasis and represents another aspect to this focus device. In Old English, this inverted order had a considerable dramatic force and was typical of lively narrative sequences. It has still retained a kind of mock dramatic effect, as the examples below show:
Out jumped the goblins, big goblins, great ugly-looking goblins, lots of goblins.
Then in crept the Hobbit.
Deep down here by the dark water lived old Gollum, a small slimy creature.
Suddenly came Gollum and whispered and hissed.
As the above four examples illustrate, these constructions always involve fronted phrases (like directional and positional adverbials) and the verbs are intransitive (typical verbs of movement or location). In these examples, the verbs jumped, crept, lived, and came have shifted to precede their subjects the goblin, big goblins, great ugly-looking goblins, lots of goblins, the Hobbit, old Gollum, and Gollum.