Set new bone length depending on the pose position not rest position
The principle is to take the delta between the previous bone (shoulder) tail and the empty's position (in local coordinate) in pose mode.

Then add this delta to the previous bone's tail in edit mode.

A point where I have spent a lot of time (as newbie here...): 'Vector' in Python is a pointer. So if you don't copy (v.copy()) the vector before you switch between pose and edit mode, the values are changed!

But from that, the result is finally simple:

import bpy

scene = bpy.context.scene
arm = bpy.data.objects['Armbvh']
newbonename = 'My_NewBoneMarker'

empty = scene.objects.get(newbonename)
emptyInLocal = arm.matrix_world.inverted() * empty.location

#Get the parent bone in POSE MODE
bpy.ops.object.mode_set(mode='POSE')

parentBonePose = arm.pose.bones['ParentBone']
parentBonePoseTail = parentBonePose.tail.copy() #Use copy() as if not switching to edit mode will change the values

#Go to edit mode
bpy.ops.object.mode_set(mode='EDIT')

parentBoneEdit = arm.data.edit_bones['ParentBone']

newbone = arm.data.edit_bones.new(newbonename)

if newbone.name != 'Origin':
    newbone.use_connect =  True

newbone.parent = parentBoneEdit
newbone.head = parentBoneEdit.tail
#The tail is the head + the delta between the empty and the tail in pose mode
newbone.tail = newbone.head + (emptyInLocal - parentBonePoseTail)

bpy.ops.object.mode_set(mode='OBJECT')