How do I set frame_end in the scene using script when I switch between different actions?
The following snippet will loop over all actions and prints the length in keyframes of each action, the scenes keyframe position is adjusted. 

import bpy

frame=1
for action in bpy.data.actions:
    print( "action=%s" % action.name )
    print( "action length=%d" % action.frame_range.y)
    frame = frame + action.frame_range.y
    bpy.context.scene.frame_set( frame )
    print( "frame=%d" % frame)