NEXTAFTER function consumes two numeric parameter from the top of the stack and pushes back the DOUBLE adjacent to the first argument in the direction of the second argument. In other words, the result is between from and to and adjacent to from.
Since 2.6.0, this function can be applied to a LIST of numerical values and a numerical value. Considering this function as
F, the result of
$a [ $b $c ] F is
[ $a $b F $a $c F ] and the result of
[ $a $b ] $c F is
[ $a $c F $b $c F ].
Since 2.7.1, this function can be applied to a GTS of numerical values. This is very similar to how this function works on LISTs, considering the values of the GTS. In that case the result is a GTS.