Like other adverbs or adverbial phrases, its location in the sentence is pretty flexible.
sounds to me, no longer at the end of a sentence is stronger and more empathetic on the "no longer" part.
Not sure whether you can say: No longer was I lonely. or No longer I was lonely. ?