OK, not so quick reply
I don't know what happened here because I remember Ben responding to this as I walked out of the office the other day. So I am sorry for any trouble. He must have accidentally closed before posting or something.
assign them that role (something about updating SFSXUserRoles table), then maybe some other action that makes this role take affect(??).
Yes. You are basically looking at being your own SecurityDialog. In essence you will need to manipulate the tables to move the permissions and/or roles to the appropriate user for the appropriate "application project" (referring to projects within your application). You are on the right track here. This is obviously a little more advanced than standard use, but is possible all the same. One thing that might help you visualize the tables a little better is in the Security Help file:
Defining Security within the Appplication -> Deploying Security Data
Just go to the bottom and you will see some screen shots of the tables with data. One other topic that may help is the hierarchy of the permissions. For example, if you have a role with a permission defined, it can be overridden at the user level. Obviously if the user permissions are left alone and you go solely off of a role here, you only have to move one record around. If you go to the user individual permissions level you will have to move the number of records that pertain to your project settings. Just a tip
Security Maintenance -> Permissions -> Permission Hierarchy
Allow the user to switch projects. They are already authenticated, just need to provide them a list of projects (this I can do), they pick one, lookup the role for that project, then back to assigning them that role and some action to make it take effect.
You can just manually re-login the user to get the permissions up to date.
MicroFour.StrataFrame.Security.Login.SetLoggedInUser(...)
You can learn more about this under the web applications authentication. Defining Security within the Application -> Web Applications -> Authenticating Users
Allow user to logoff, then log back in, of course, this would include all the project stuff again
Not much to say here other than yes. Once you change the permissions the will take effect the next time they log on.
Lock app, so they have to reauthenticate to continue. Not sure how any open forms are handled here at all. Any info would be helpful as well as info on how to implement.
This is called session locking and is an easy to implement feature. To learn more about this, look in the help docs under: Security within the Application -> Session Locking
To implement session locking, look at the article: Defining Security within the Application -> Adding Security to an Existing Application
Go down to 5c and you will see how to start the session monitoring.