Code:
def get_actions(filename): # get entity actions from wmb file
    actions = []
    f = open(filename, "rb")
    f.seek(4+8+8+8+8+8+8+8+8+8+8+8+8+8+8+8)
    offset, length = struct.unpack("ll", f.read(8))
    f.seek(offset) # jump to object list
    object_offsets = []
    for i in range(struct.unpack("l", f.read(4))[0]):
        object_offsets.append(struct.unpack("l", f.read(4))[0])
    for o in object_offsets:
        f.seek(offset + o)
        type = struct.unpack("l", f.read(4))[0]
        if type == 7 or type == 3: # entity
            f.seek(offset + o + 4 + 4*3*3)
            # strings don't always seem to start at the same position!? -> regular expression necessary
            n = re.split("\x00+", struct.unpack("86s", f.read(86))[0])
            if n[2]: # action exists
                actions.append((n[0], n[2])) # entity name, action name
    f.close()
    return actions



and here is my level_load() function:
Code:
def level_load(filename, g):
    # only keep threads where my isn't set
    new = [thread for thread in threads if thread[2] is None]
    del threads[:] # delete all elements but keep the original list instance
    threads.extend(new)
    # load level
    _level_load(filename)
    # start actions
    if filename[-3:].lower() == "wmb":
        if not os.path.exists(filename):
            for path in e.pPaths: # look for file in all paths that got added with add_folder()
                f = os.path.join(path, filename)
                if os.path.exists(f):
                    filename = f
                    break
        actions = get_actions(filename) # get entity actions from wmb file
        for action in actions:
            entity = ent_for_name(action[0])
            entity.eflags &= ~ANIMATE
            entity.emask |= DYNAMIC
            e.my = entity
            eval(action[1] + "()", g)
            e.my = None