Non-Wraping Up-Down Counter
Not wrapping is simply a matter of adding checks to see if it would wrap, and inhibiting the counting in that case:

module counter
(
    input               clock,
    input               reset,
    input               en,
    input               dir,
    output reg [1:0]    count
);

  always @ (posedge clock) begin
    if (reset == 1'b1) begin 
      count &lt;= 2'b0; 
    end else if (en == 1'b1) begin
      if (dir == 0) begin
        // up count when dir=0 AND count &lt; max value (all ones)
        if (count != 2'b11) count &lt;= count + 1;
      end else begin
        // down count when dir=1 AND count &gt; min value (all zeros)
        if (count != 2'b00) count &lt;= count - 1;
      end
    end
  end

endmodule


P.S. I'm not sure why you were resetting count when en == 0, so I've eliminated that here.