I don't believe that there are DIF and LAG functions for a matrix, but you really don't need them. You can loop over your list/matrix and reference (i-1) or (i+1), where i is your looping index.
BTW I wouldn't use list as a variable, as it is a function in JSL.
Or, you can just sort your matrix:
a = [1, 3, 5, 7, 5, 9, 11, 13, 10, 14, 15, 17];
b = sort ascending(a);
[1, 3, 5, 5, 7, 9, 10, 11, 13, 14, 15, 17]