What parts of my Python code are adopting a poor style and why?
I also have a tendency to do things like spam = fun() because I do not
  know how to correctly make Python call a function which changes a
  variable in the scope of where the function was called.


You can't. You cannot replace a variable in an outer scope. So in your case, you cannot replace the list with a new list, although you can modify the list. To make it clear

variable = expression


replaces a variable, whereas pretty much anything else:

variable[:] = expression
variable.append(expression)
del variable[:]


Modifies the object. The bottom three will take effect across all references to the object. Whereas the one before replaces the object with another one and won't affect any other references.

Stylistically, it somestimes makes sense to have a function modify a list, and other times it makes sense for a function to return a whole new list. What makes sense depends on the situation. The one rule I'd pretty much always try to follow is to not do both. 

def randomize_list(the_list, x=MAX):
    for i in range(len(the_list)):
        the_list[i] = random.randint(1, x)


This isn't a good place to use a modified list. The incoming list is ignored except for the length. It'd be more useful as a function that returns a a new list given a size something like:

def random_list(length, maximum = MAX):
    random_list = []
    for _ in range(length):
        random_list.append( random.randint(1, maximum) )
    return random_list

def lengthen_list(the_list, desired_length, x=MAX):
    if len(the_list) &gt;= desired_length:
        print "erroneous call to lengthen_list(), desired_length is too small"


Don't report errors by print, raise an exception

 raise Exception("erroneous call...")


        return the_list
    while(len(the_list) &lt; desired_length):
        the_list.append(random.randint(1, x))
        # organize the_set
        the_list = set(the_list)
        the_list = list(the_list)


That's not an efficient way to do that. You constantly convert back between a list and set. Instead do something like

 new_value = random.randint(1, maximum)
 if new_value not in the_list:
      the_list.append(new_value)


That way you avoid the jumping back and forth, and it also modifies the original object rather then creating a new list.

    return the_list


This particular function could go either way in terms of modifying or returning the list. Its a judgement call which way to go. 


  Also is it bad to be writing code in this space and I should create a
  function or class to call from that space which contains most my code?


Yes, you should really put everything in a function and not at the main level for all but the most trivial scripts.