Editing the official pie menus add-on fundamentally
I can think of two approaches that don't involve altering the pie menu addon.

First is to alter the keyboard shortcuts, blender can use any key as a modifier so you can keep &#8633; Tab to toggle edit mode and hold E and press &#8633; Tab to show the pie menu. The standard edit mode shortcut is left in place, the pie menu addon just gets the tab key before the default shortcut.



Another approach that gets closer to your idea is to create an addon that runs an operator on a timer to decide after the set time if it should toggle edit mode or show a pie menu. As it is, this example is awkward to use but could probably be improved with a bit more work. The full addon can be found here with the main operator showing the idea below. The mouse positions passed into the operator's modal() are from the previous modal() call rather than the initial execute, this leads to the mouse needing to be moved just as the timer is triggered to get the menu to show.

class TimedEditMode(bpy.types.Operator):
    """Go into edit mode if tab is held down"""
    bl_idname = "wm.timed_edit_mode"
    bl_label = "Timed Edit Mode"
    _timer = None

    def modal(self, context, event):
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            self.cancel(context)
            return {'CANCELLED'}

        if event.type == 'TIMER':
            move_x = abs(event.mouse_x - event.mouse_prev_x)
            move_y = abs(event.mouse_y - event.mouse_prev_y)
            move_threshold = context.user_preferences.view.pie_menu_threshold

            if move_x &gt; move_threshold or move_y &gt; move_threshold:
                bpy.ops.wm.call_menu_pie(name='OBJECT_MT_mode_menu')
                return {'FINISHED'}
            else:
                bpy.ops.object.mode_set(mode='EDIT', toggle=True)
                return {'FINISHED'}
        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(time_to_wait, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)