In this, the whole sentence before "kimi" is modifying "kimi". Japanese puts all descriptive phrases before the noun that gets modified. As for how you learn it... a textbook should get around to it pretty early on, I'd think.

As for when sentences actually get inverted.... seems like something you would just pick up through enough use of the language. But maybe someone has some general rules to follow that I don't know about.

The last よ in 言えない痛み悲しみで傷ついた君よ is a marker for a special kind of "call." It's kind of difficult to explain this in English because it doesn't seem English has a word having the exact same function.

For example, 僕よ。 in ｐｓ３を買った僕よ。 sounds like "me" as in "Stupid me. I should have bought Xbox..." If the person who got hurt were you, the 君よ at the end of the sentence is like "kentaku_sama" as in "Poor kentaku_sama."

Lyrics often use unusual word order to add poetic senses, fit words to musical notes and rhythms, exploit rhyme, etc.

I don't think word order changes in conversation and such are the most difficult thing. You'll get the hang of it pretty quickly if you listen to lots of Japanese, I think.

Before you criticize someone, walk a mile in their shoes. That way when you criticize them, you are a mile away and you have their shoes.

The よ is the main point here I think; you couldn't rewrite the sentence without the modifying clause because then you wouldn't be able to use that 'calling' type of よ (it would be the 'information/exclamation' type of よ instead).

The OP's line appears (at least) twice in the song, followed by lines like消せない過去も背負いあっていこう 生きる事を投げ出さないでandもう笑えないなんて 人嫌いなんて 言葉そう言わないで

As far as I know, the よ at the end of this line just "addresses" these suggestions/requests/commands to 君.