In general, modifying sorting behavior is based on the view implementation. The built-in AgendaView orders events chronologically in ascending order. Therefore, to customize this, you could either use the workaround that I mention in my last reply or alternatively extend the specified view.
I have prepared a basic example that shows how the desired functionality could be achieved with custom view (Reversing the events order):
Please review the above implementation and use it as a starting point to further implement the rest of your project requirements.