How can I perform the following, if possible:
Redirect a user, based on the page they were viewing, before they registered?
1) User starts at page A, clicks the registration link and registers, and is redirected back to page A
2) User starts at page B, clicks the registration link and registers, and is redirected back to page B
Right now, your plugin will always redirect to the same page, regardless of the page that was viewed, prior to registration.
Unfortunately, you can't. That's a limitation of Joomla itself. Our SCLogin module simply redirects the user to the standard Joomla Registration page. Joomla has it hard-coded that the user will always be brought to the Registration Complete page (if activation is enabled) or the Login page (if activation is disabled). There's no way to pass a redirect parameter to Joomla's registration logic to let it know where the user should go after they register.
Sorry for the inconvenience. This is something our social integration does resolve. When users register through Facebook, LinkedIn or Goolge (coming to our Facebook integration extension next month), you can select where they are redirected after their account is automatically created. With Joomla though, that's something that's not easily possible without editing Joomla's code itself.
I hope that helps explain, and best of luck,