User Preferences - Test and Set "object_align"

Can someone help me understand how to test the current setting of “Align To:” on the Editing panel of the User Preferences page, set it to “View”, and then return it to the original setting when the script is complete?

I want to create a mesh based on the “View” coordinates and not the “World” coordinates. Once I have created the mesh I want to return the setting to whatever the user had setup originally. (“World” by default)

Is there a better approach to create the mesh using the “View” coordinates?

Probably obvious but I am new to Python.
I’ve done some non-graphics based programming with VB but this is all new.