ну вам же edison показал готовую регулярку..
var str = '\
//![\n\
//colors for drawings \n\
var colorspal = [\'red\', \'blue\', \'green\'];\n\
//status captions\n\
var scaptions = ["Very bad", "Amiss", "Poorly", "Illy", "Commonly", "So so", "Good", "Fine", "Perfect", "Outstanding"];\n\
//status colors\n\
var scolors = ["#CD0A31", "#F43445", "#F44C34", "#F47634", "#F49C34", "#F4C934", "#F4F434", "#D5F434", "#AEF434", "#5BBE3C"];\n\
//!]\ ';
console.log(str);
var str = str.replace(/\/\/!\[[\d\s\D]*?\/\/!\]/, 'new text');
console.log(str);