I have not tried this, but here's an idea:
You could have 2 session variables e.g. CurrentURL and PreviousURL.
Then, in the preparation of all web screen (or the preparation of a web block present in all screens) you could use HTTPRequestHandler extension:
- Session.PreviousURL = Session.CurrentURL
- Session.CurrentURL = HTTPRequestHandler.GetURL()
After this, whenever the you want to redirect the user to the previous screen you could use an external site with a dynamic URL parameter that receives the PreviousURL value.