Encoder runout will only pause when switching to T0, T1 and T2 runout does not trigger

Probably not. initial_duration: 3 will call all these macros 3 seconds after printer start. If you want to delay the execution you need to do it via the UPDATE_DELAYED_GCODE DURATION

Maybe something like:

[gcode_macro __MYVARIABLES]
# Hidden helper macro for the sensor variable to be used later
variable_my_sensor: ''

[gcode_macro enable_runout_sensor]
# Helper macro to enable runout sensor
gcode:
    # Get the sensor that was specified in the tool macro
    {% set my_sensor = printer['gcode_macro __MYVARIABLES'].my_sensor %}
    # Activate the sensor
    SET_FILAMENT_SENSOR SENSOR={my_sensor} ENABLE=1

[gcode_macro T0]
gcode:
    # make sure all filament sensors are deactivated
    SET_FILAMENT_SENSOR SENSOR=my_sensor_T0 ENABLE=0
    SET_FILAMENT_SENSOR SENSOR=my_sensor_T1 ENABLE=0
    SET_FILAMENT_SENSOR SENSOR=my_sensor_T2 ENABLE=0
    # Deactivate stepper in my_extruder_stepper
    SYNC_EXTRUDER_MOTION EXTRUDER=belted_extruder1 MOTION_QUEUE=""
    SYNC_EXTRUDER_MOTION EXTRUDER=belted_extruder2 MOTION_QUEUE=""
    # Activate stepper in extruder
    SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
    # "Globally" set the sensor to activate
    SET_GCODE_VARIABLE MACRO=__MYVARIABLES VARIABLE=my_sensor VALUE='my_sensor_T0'
    # Call enable_runout_sensor with a delay of 3 sec
    UPDATE_DELAYED_GCODE ID=enable_runout_sensor DURATION=3

You will need to repeat this for the other tools and adapt the SET_GCODE_VARIABLE MACRO=__MYVARIABLES VARIABLE=my_sensor VALUE='my_sensor_T0' to the respective sensor.

Untested, may burn down your house.

Edit:

  1. Fixed typo
  2. Yet another one
  3. Reserved for future fixes
  4. Reserved for future fixes