Replace outside comma with newline
How about:

hobbies = "Hobbies: \nsports (basketball, gym), foods (hamburger, steak, pasta), reading, movie, justfortesting((test1, test2), test3)"
print "\n\nBefore: \n\n" + hobbies

counter = 0
hobbies = hobbies.chars.map do |char|
  next "\n" if char == ',' and counter == 0
  counter += 1 if char == '('
  counter -= 1 if char == ')'
  char
end.join
counter = nil

print "\n\nAfter: \n\n"
hobbies.each_line do |line|
  puts line.lstrip
end