I don't understand why you need to do that.
Oh, I see. In the 'bad old days' Moodle used a table with three columns for the layout, and the columns in the HTML were ordered pre, main content, post.
So, when the page started <html dir="ltr"> then the pre column was on the left, and the post column was on the right. And, if you switched to <html dir="rtl"> then the browser automatically displayed pre on the right, and post on the left, and that is what we wanted.
No, we have switched the HTML to be three divs in the order main content, pre, post.
And they are positioned with CSS float left/right.
And in CSS, left and right mean left and right. There are no CSS commands that correspond to 'first in reading order' and 'last in reading order'.
I guess you have to search the CSS for all occurrences of the words left and right. Also, you need to find every place where someone has written a compressed rule like margin: 0 2em 0 0;
What a pain.