Tile *Previous* Window Side-by-Side with Current
It can be done via AppleScript.

I might be able to fudge some kind of script for you in a day or so, but take a look at:

http://tom.scogland.com/blog/2013/06/08/mac-raise-window-by-title/
(mostly for how to make the script non-specific to an an application) and  https://macosxautomation.com/applescript/firsttutorial/04.html
(for relative window indexes).

I don't unfortunately know the scripting terminology for placing windows side-by-side, so either someone else can take a crack at it, or I will in a couple days.