Parses code fence blocks (```r ... ```, ```R ... ```, ``` ... ```)
out of LLM responses. If multiple fences exist, concatenates them. If no fence
is found, falls back to the trimmed raw text. Strips extraneous whitespace
and returns valid R code.
