see [kawaru-group] for explanation and similar items
dc
(Verb)た + 代わりに (B) - An action has taken place and in order to make up for that someody does (B). 私はトムに日本語を教えてあげた代わりに彼に英語を教えてもらった。 I taught Tom Japanese, so (to make up for it) he taught me English
(Adj) い + 代わりに (Adj) な + 代わりに This is like が、けれど、しかし etc, but has the added meaning of compensation or balancing. e.g. アパートは高い代わりに便利だった The apartment was expensive but it was convenient (in a way that makes the expensiveness of the seem not as bad)
bluntcrayon
the ex #1167 is not the right form for this one. It belongs in the kawari ni (1) section). The subordinate clause should be in past tense for it to convey "in order to make up for it". so should be 昼間遊んだ代わりに夜勉強するつもりだ。