if $regex(%n, /^[-]{0}([0-9]{2})$/) == 0 $&
msg $nick You must use 02 digits for this function to work correctly.
else $&
/do.whatever
; or, even simpler (but several more steps, therefore slower):
if $len(%n) != 2 || %n !isnum 0-99 $&
msg $nick You must use 02 digits for this function to work correctly.
else $&
/do.whatever