structure.py: tabs -> spaces

We had mixed whitespace before, which was causing problems.
Fixed a syntax error.
Tweaked a faulty condition.

In the fragment:

...and (not mode)) or ...

We were trying to check whether or not mode had been explicitly set by
the caller. Unfortunately, OBJ_MODE has a value of zero, which is
treated as false, so this won't do what we want.

The condition now explicitly compares with None.