You could make this much simpler if you just called the sample method inside your always block. This would also improve performance.
covergroup count_active_inactive;
inactive: coverpoint counter iff (sig) {bins cycles[] = {1,2,3,[4:$]};}
active: coverpoint counter iff (!sig) {bins cycles[] = {1,2,3,[4:$]};}
endgroup
count_active_inactive cai = new();
always @(posedge clk) begin
if ($stable(sig))
counter <= counter + 1;
else begin
cai.sample();
counter <= 1;
end
end