Yes you can do something like:
IF YourCondition THEN
EXIT;
this skips the modify if the condition is not met.
Please remember that this is a bad coding rule. This trigger (onmodify) is executed before the default modify behavior is executed. If an error occurs in the trigger code, the record changes are canceled. We recommend that you do not include code that can stop the user from recording a change in the OnModify trigger on a table