var arr = ["#f00", "#ff0", "#f0f", "#f66"];
(function recurse(counter) {
var arrLength = arr.length;
var index = counter%arrLength;
var color = arr[index];
$('#colorblock').delay('1200').animate({
backgroundColor: color
}, 600);
setTimeout(function() {
recurse(counter + 1);
}, 200);
})(0);