How to change the current action on dope sheet editor with script?
For me this just worked fine:

#reguirement: you got action called "Idle"
csontvaz_objektumkent = bpy.data.objects[0] #this is actually the armature, but I use index
                                            #because I am lazy
bpy.context.scene.objects.active = csontvaz_objektumkent
csontvaz_objektumkent.animation_data_create()
csontvaz_objektumkent.animation_data.action = bpy.data.actions["Idle"]


I am sorry if it looks bad: I am pretty new to BPY.