Since the index i doesn't appear inside { } your script merely repeats the summation col(TOTAL)[4]=col(FLOW)[4]+col(FLOW)[5]+col(FLOW)[6]+col(FLOW)[7] four times. I think you're looking for a shorter way to perform that summation once. a+=b is short-hand notation for a=a+b so this is one possibility...
If you intend to repeat the col(TOTAL)[j] calculation for j=19,24,29,... then vector math will be much more efficient. The ave(dataset,n) function returns a dataset containing the averages of dataset taken n rows at a time...
ii=4; // starting row jj=5; // group size set col(FLOW) -b ii; // hide first ii-1 rows in col(FLOW) tmp=ave(col(FLOW),jj); // average visible rows jj at a time tmp *= jj; // multiply by jj to get sums get tmp -e npt; // npt = # of results for(i=0;i<npt;i++) { col(TOTAL)[i*jj+ii]=tmp[i+1]; // transfer results to col(TOTAL) }; del tmp; // delete temporary dataset set col(FLOW) -b 1; // show all rows in col(FLOW)