function createActionForText (text) {
  var text_left_border_start = text.indexOf("[color="),
      text_left_border_end = text.indexOf("]", text_left_border_start),
      color = text.slice(text_left_border_start + 7, text_left_border_end),
      text_right_border_start = text.indexOf("[/color"),
      text_right_border_end = text.indexOf("]", text_right_border_start),
      value = text.slice(text_left_border_end + 1, text_right_border_start),
      text_array = text.split("");
  text_array.splice(text_right_border_start, 8);
  text_array.splice(text_left_border_start, color.length + 8);
  return {
    text: text_array.join(""),
    start: text_left_border_end - (color.length + 8),
    end: (text_left_border_end - (color.length + 8)) + value.length,
    color: color
  }
}
console.log(createActionForText(text));
У меня вроде получилось примерно то что надо, но как то уж больно громоздко выглядит, может можно как то поизящнее это сделать?