How to store multiple added empties IDs used in a warp modifier so they don't conflict with new warp modifiers?
Using API methods.
A common misapprehension in blender is that create / add &quot;anything&quot; operators return the newly created thing, instead the newly created thing is found from context. Eg for add object primitives the new object is context.object directly after the call (if run in OBJECT mode) A newly added modifier sits last in the objects modifiers collection.
That said, it is a lot, lot, lot  easier (IMO) to totally ditch the operators  &amp; instead use related API methods which return a reference.
Below is an operator-less re-rig of question code to run entirely in EDIT mode

Select a vertex

Adds a warp modifier, once again using the related API method new_mod = Object.modifiers.new(...), so we have its reference.  The new modifiers show in edit mode is set, so we can see the result.

Adds two empties, the first is at the location of the vert, the second is offset from the first by the value set for offset These are assigned as the &quot;from&quot; and &quot;to&quot; objects of the modifier.

The empties are given a name to reflect object warping, which modifier, from or to.  Other things to consider would be putting the empties into their own collection.

Looped over the &quot;object_from&quot;, &quot;object_to&quot; properties of the modifier.  setattr(warp, k, ob) is equivalent to warp.object_from = ob when k == &quot;object_from&quot;.

The offset is in global coordinates. This is converted to local since the empties are being parented to the warping object. Think this answer helps explain the maths used Which matrix to use to transform children local coordinates to global?


Test code.
import bpy
import bmesh
from mathutils import Vector
from bpy import context

offset = Vector((0, 0, 1))


col = context.collection
ob = context.object
mw = ob.matrix_world
mwi = mw.inverted()
me = ob.data

bm = bmesh.from_edit_mesh(me)

vert = bm.select_history.active
# if not a vert then throw error
assert(isinstance(vert, bmesh.types.BMVert))

warp = ob.modifiers.new(&quot;Warp&quot;, type='WARP')
warp.show_in_editmode = True
for k in (&quot;object_from&quot;, &quot;object_to&quot;):
    mt = bpy.data.objects.new(f&quot;{warp.name}_{k}&quot;, None)
    
    col.objects.link(mt)
    
    if k.endswith(&quot;from&quot;): # 
        mt.location = vert.co
    else:
        mt.location = vert.co + mwi @ offset

    setattr(warp, k, mt)
    mt.parent = ob