finally I got it to color only non-empty cells with desired colors. but there is still an error though the script is executable.
=Data Table( "Bin Wafer Map" );
(i=4, i<=N col(dt),i++,
(j=1, j<=N Row(dt),j++,
if(dt:i[j]==1,dt:i << Color Cells(Green,{j}),
if(dt:i[j]==3,dt:i << Color Cells(Red,{j}),
if(dt:i[j]==4,dt:i << Color Cells(Yellow,{j}),
if(dt:i[j]==5,dt:i << Color Cells(Orange,{j}),
if(dt:i[j]==6,dt:i << Color Cells(Magenta,{j}),
if(dt:i[j]==7,dt:i << Color Cells(Blue,{j}),
if(dt:i[j]==8,dt:i << Color Cells(Cyan,{j}),
if(dt:i[j]==9,dt:i << Color Cells(BlueCyan,{j}),
))))));
(i=4, i<=N col(dt),i++,
(j=1, j<=N Row(dt),j++,
(!zero or missing(dt:i[j]),dt:i[j]<<color cell by value(1),
)));