macros are nice... but hfs knows when building the page by which field and in wich order the list will be sorted.
Why not offer directly some values as status:
%statsort% (possible values:"fname,ext,size,time,hits,com") and
%statorder% (values:"up,down" or 'asc,desc' or 'norev,rev')
instead of evaluating 5 lines of nested macros?