This is possible. Have a look at the “WordPress as the SSO Client” section of Install and configure the WP Discourse Wordpress plugin for Discourse.
The plugin can be configured to handle everything up until your 4th point. The WP Discourse plugin doesn’t know anything about the membership plugin that you have installed on your WordPress site, so any integration between that plugin and Discourse will have to be developed by you. It should be possible to do this, but the most common use of the WP Discourse plugin with memberships is to have WordPress as the SSO provider for Discourse, so there are not any code examples that I know of that are doing things in the way you are proposing. I think it would be a good use of the plugin though.