This might work for you (GNU sed):
sed '/```/{s//{>>/;:a;n;s//<<}/;Ta}' file
Match a line containing ```
.
Replace that line by {>>
.
Read/print following lines.
When another line matches the same regexp, replace it by <<}
.
N.B. T
branches when the last substitution fails. It is the dual of t
.
See here for demo.