You can always use a global variable to set whenever you're scripting the sort that lets you know how you last sorted.
Taylor's method is what most of us use.
To answer your question, no, there is no function that returns what order something is sorted on. You have to keep track of it yourself.
Something scripted like:
-Set Variable $$SortField = "the field you're sorting on"
-Set Variable $$SortDirection = "ASC/DESC"
Then you could either do some sort of conditional formatting, or FM13's new "Hide Object when" feature to show and hide buttons accordingly.
IE in FM13, if I have blue arrows up and down, and red arrows up or down, and a table::name field. I could apply this to those 4 buttons:
Blue up = Hide object when - $$SortField = table::name
Blue down = Hide object when $$SortField = table::name
Red up = Hide object when - $$SortField =/= table::name and $$SortField > "" and $$SortDirection = "DESC"
Red down = Hide object when $$SortField =/= table::name and $$SortField > "" and $$SortDirection = "ASC"
This would give me blue up and down arrows when it is not sorted by that field, and then a red arrow to indicate when it IS sorted by that field, and which direction. You can always make this more complex by adding in the ability to add/remove fields to your sort order as well.
Thanks for the detailed reply. This is essentially what I did.