- "コテンパンにやられる" is a passive form of "コテンパンにやる". "コテンパンにやる" is also said "コテンパンにやっつける" in the same meaning. They both mean "to beat a person black and blue".
- "尻尾{しっぽ}を巻{ま}いて逃{に}げる" is an idiomatic phrase in Japanese that expresses figuratively how a person behaves when he loses the fight by quoting how a dog sneaks away or runs off with its tail between its legs when the dog loses the fight.
Since I learned that they use "to turn tail and run" to describe the same situation in English, it is very interesting that these expressions are very similar in both languages. [1]: http://jisho.org/search/%E3%82%88
Since I learned that they use "to turn tail and run" to describe the same situation in English, it is very interesting that these expressions are very similar in both languages. [1]: http://jisho.org/search/%E3%82%88