Lets's start with the details provided in the code wizard:

Now let's move to some examples.
First, let's demonstrate how the offset is used. For all examples assume today is April 30th 2018.
Example 1 (using negative 1 for the offset):
qie.debug('Q: Is given date within one day prior to today?');
qie.debug("A: for '04/28/2018': " +
qie.isDateWithin('04/28/2018', -1, 'DAY'));
qie.debug("A: for '04/29/2018': " +
qie.isDateWithin('04/29/2018', -1, 'DAY'));
qie.debug("A: for '04/30/2018': " +
qie.isDateWithin('04/30/2018', -1, 'DAY'));
qie.debug("A: for '05/01/2018': " +
qie.isDateWithin('05/01/2018', -1, 'DAY'));
qie.debug("A: for '05/02/2018': " +
qie.isDateWithin('05/02/2018', -1, 'DAY'));
Output:
Q: Is given date within one day prior to today?
A: for '04/28/2018': false
A: for '04/29/2018': true
A: for '04/30/2018': true
A: for '05/01/2018': false
A: for '05/02/2018': false
Example 2 (using positive 1 for the offset):
qie.debug('Q: Is given date within one day following today?');
qie.debug("A: for '04/28/2018': " +
qie.isDateWithin('04/28/2018', 1, 'DAY'));
qie.debug("A: for '04/29/2018': " +
qie.isDateWithin('04/29/2018', 1, 'DAY'));
qie.debug("A: for '04/30/2018': " +
qie.isDateWithin('04/30/2018', 1, 'DAY'));
qie.debug("A: for '05/01/2018': " +
qie.isDateWithin('05/01/2018', 1, 'DAY'));
qie.debug("A: for '05/02/2018': " +
qie.isDateWithin('05/02/2018', 1, 'DAY'));
Output:
A: for '04/28/2018': false
A: for '04/29/2018': false
A: for '04/30/2018': true
A: for '05/01/2018': true
A: for '05/02/2018': false
Now compare the output from both examples above to the table below for the DAY date unit.

In the table above we can see that if we call this function again but change the date etc. like this "qie.isDateWithin('04/27/2018', -1, 'DAY');" that we can expect false as the result.
One more example:
Example 3 (using negative 3 for the offset):
qie.debug('Q: Is given date within 3 days prior to today?');
qie.debug("A: for '04/26/2018': " +
qie.isDateWithin('04/26/2018', -3, 'DAY'));
qie.debug("A: for '04/27/2018': " +
qie.isDateWithin('04/27/2018', -3, 'DAY'));
Output:
A: for '04/26/2018': false
A: for '04/27/2018': true

So, you can see how the range pushes out from today, either in the past or future, based on the offset.
The dateUnit also changes the range as can be seen in the table below:

See also:
What is today? Can I check to see if a date is today?