Crafting an IPN page can be a little tricky if you have not done one before. If you have eCart there is a function you can use that will check to ensure the post coming to your IPN page is valid, this function is applied automatically in combination with the get contents from form server behavior when PayPal IPN is specified as the source. If you do not wish to populate an eCart from the IPN post you can use this function by itself, it is called WA_isValidPayPal() and can be found in the WA_eCart_Definition_PHP.php file.
In order to associate the subscription purchase with a user you will need an identifier. If you use the custom variable when sending the user to PayPal you can get back whatever you put in this variable on your IPN page. You can use this as an identifier for the user, or the order. You could check this value and update your db based on it. For example if you store the user's email or id from the db in this field you can use it as the reference for your update server behavior so that you know what record to update.
Post back with any other questions that you have or if you run into any problems and we will be glad to help. Also, make sure that you are testing your IPN page along the way by using the PayPal IPN tester in the developer center.