IF %NUMBER >= 4 AND %NUMBER <= 8 THEN
%END := 5
The above says that if a number is 4 or higher, and 8 or lower (so between 4 and 8), then END is equal to 5.
That's the basic syntax. You'd have to be more specific with what you actually want to happen for any more detail.