bpy.ops.wm.addon_expand(module="module_name") works in console, but not in add-on
Whether an addon is displayed expanded or not in the User Preferences is stored in the bl_info dictionary, in the property called show_expanded.

addon_utils manages a cache of addons. It uses the global addons_fake_modules. It can be used to determine and change the expand state:

import bpy
import addon_utils

# Get a module reference by name
mod = addon_utils.addons_fake_modules.get("space_view3d_3d_navigation")

# If found, expand it
if mod is not None:
    mod.bl_info['show_expanded'] = True

    # Find User Preferences area and redraw it
    for window in bpy.context.window_manager.windows:
        for area in window.screen.areas:
            if area.type == 'USER_PREFERENCES':
                area.tag_redraw()


Note that running this code as part of an addon is tricky, see e.g.:


http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Restricted_Context
https://blender.stackexchange.com/a/18134/1363