Not sure if this violates your request that it be an *attribute* value... or if that request was just because you thought that using an attribute was the only way to do a deferral like this... but, in any case, I just tested this and it works, so use it if it will suffice.
You probably have a ton us reasons to use/keep your @{defer} attribute on the character, so instead of changing that one, let's create another called @{abil_defer}
Construct it the same way, except use the % sign instead of the @ symbol...
<Attrib> <Min val> <Max val>
@abil_defer %{<character>|defer %{<character>|
Then change @{DTD0} and @{DTD1} to be abilities instead of attributes... so instead of constructing
@{DTD0}
...or...
@{DTD1}
...you are instead constructing
%{DTD0}
...or...
%{DTD1}
In DTD1, put both commands on their own line (at a minimum):
!token-mod --set currentside#1 --ids @{<character>|character_id}
!setattr --charid @{character_id} --silent --DT||0
This will work.
...
"...but if you leave the camera rolling..."
...
I would suggest you use ZeroFrame batching, here to avoid the dropped line bug (where one command might fire, but the other gets dropped by Roll20). I would just install the full Metascript Toolbox to get ZeroFrame. Then you can construct your DTD1 ability to look more like this:
!{{
!token-mod --set currentside#1 --ids @{<character>|character_id}
!setattr --charid @{character_id} --silent --DT||0
}}
(spaces at the start of the lines are optional, but I find it easier to read).
That will get you around the dropped line bug.
...
"...but if you leave the camera rolling..."
...
You could bypass the need for the deferral completely if you used a logical IF statement from the Metascript Toolbox:
!{{
{&if @{<character>|DTD|max} = 1}
!token-mod --set currentside#1 --ids @{<character>|character_id}
!setattr --charid @{character_id} --silent --DT||0
{&end}
}}
That use the "max" value of the DTD attribute, the way you had it set up previously. However, if you go the route of using the conditional rather than the deferral process, you wouldn't need to devote the "current" value of the DTD attribute to the deferral process. You could simply store the 0 or 1 that you need to drive the conditional evaluation in the "current" value, and drop the "max" from the above command line.
Hopefully that all makes sense. Post back if anything is less than clear.