How can a bone's tail be changed by a script?
To change bones in an Armature, you need to use the EditBones, and the Armature has to be in editmode. As only a single object can be in editmode at a time in Blender, you need to change mode if you wanna access different Armature's EditBones.

Your script doesn't change mode and the .edit_bones property will be None if the owning Armature is in Object or Pose Mode. Thus for bone in arm.edit_bones will end immediately (nothing to loop over) and v remains None (the initial value).

I tried to make your script working, and it will have a visual effect now, not sure if it's what you want though:

import bpy
from bpy import context
import mathutils
from mathutils import Vector,Quaternion
import math

def dump2(obj, level=0):
   for attr in dir(obj):
       print( "obj.%s = %s" % (attr, getattr(obj, attr)))

def setBone(name, v):
    arm = bpy.data.objects.get(name)
    if armature_prepare(arm):
        print("set arm=" + name + " v=" + str(v))
        for bone in arm.data.edit_bones: 
            print( bone.tail )
            bone.tail= v

def armature_prepare(arm):
    if arm is not None and bpy.ops.object.mode_set.poll():
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.select_all(action='DESELECT')
        bpy.context.scene.objects.active = arm
        arm.select = True
        bpy.ops.object.mode_set(mode='EDIT')
        return True
    return False

def getBone(name):
    v = None
    arm = bpy.data.objects.get(name)

    if armature_prepare(arm):
        print("get arm=" + name + " arm=" + str(arm))
        for bone in arm.data.edit_bones: 
            print(bone.tail)
            v = bone.tail
    return v

def vec():
    mx = mathutils.Matrix.Rotation(math.radians(15.0), 4, 'X')
    my = mathutils.Matrix.Rotation(math.radians(30.0), 4, 'Y')
    mz = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'Z')
    m = mx * my * mz
    print( "m : " + str (m ))

    # get and duplicate original tail pos of reference bone    
    vo = getBone("arm_org")
    if vo == None:
        print("arm_org not found")
        return
    setBone("arm_mat", vo.copy())
    setBone("arm_rot", vo.copy())
    vr = vo * m
    setBone("arm_rot", vr )

    # recalc and apply matrix from rotational difference
    q = vo.rotation_difference( vr )
    mr = q.to_matrix()
    mr.resize_4x4()
    vm = vo * mr
    setBone("arm_mat" , vm)
    print("mr: " + str(mr))
    print("-" * 20)

vec()