I think you don't really need all that stuff.
I would intercept the:
exten=>_XXXXXXXXXX,n,Macro(ael-druid-trunkdial,SIP/ipcomms,${EXTEN},WTK,,,,,${EXTEN})
and change that to
exten =>_XXXXXXXXXX,1,Set(QDIALER_QUEUE=q-999)
exten => _XXXXXXXXXX,n,Set(QDIALER_NUMBER=1${EXTEN})
exten => _XXXXXXXXXX.,n,Set(QDIALER_AGENT=Agent/${CALLERID(num)})
exten => _XXXXXXXXXX,n,Set(QDIALER_CHANNEL=SIP/trunk-name/${QDIALER_NUMBER})
exten => _XXXXXXXXXX,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXXXXXXXXX,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => _XXXXXXXXXX,n,Goto(qm-queuedial,s,1)
You have to make sure that the original QM dialplan is included.