How do I setup a password administration workflow using setPasswordPath and a forgot password page?
The form that lives at setPasswordPath assumes that the user arrived there by clicking on the link in the validation email that was sent to the provided email address.  That link includes a code=somelongid querystring parameter in the URL that the form is looking for.

If you're just loading that URL directly, then you'll get the "Variable 'code' does not exist" error.  You could always do something like this to guard against it:

{% set code = craft.request.getParam('code') %}

{% if not code %}
    {% exit 503 %}
{% endif %}


Regarding the forgot password form, upon successfully setting their new password, Craft will check to see if the user has control panel access.  If they do not, it will check the setPasswordSuccessPath config variable and redirect there.  If they do, Craft will send them to the dashboard (which will redirect to the login page if you don't have autoLoginAfterAccountActivation set.