I just recently wrote something similar for the custom TOC macro I use in InsideTiddlyWiki.
Here's a link to my code:
and here's an excerpt showing the relevant handling:
\define toc-item-drop()
<!-- get OLDTAG and NEWTAG, exclude special tags -->
<$vars sourcetags={{{ [<actionTiddler>get[tags]] }}}
targettags={{{ [<item>get[tags]] }}}>
<$vars oldtag={{{ [enlist<sourcetags>!enlist<toc-ignore-tags>] }}}
newtag={{{ [enlist<targettags>!enlist<toc-ignore-tags>] }}}>
<$reveal default=<<modifier>> type="match" text="normal"> <!-- DROP AS SIBLING -->
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>]" />
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="[<newtag>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="+[insertbefore:item<actionTiddler>]" />
</$reveal>
<$reveal default=<<modifier>> type="match" text="shift"> <!-- DROP AS CHILD -->
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>]" />
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="[<item>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<item>> $field="list" $subfilter="[<actionTiddler>]" />
</$reveal>
</$vars>
</$vars>
\end
Note that I am manipulating both "tags" and "list" fields (the TOC uses entries in the "tags" field to define a tiddler (the "actionTiddler") as a "child" of a specific "branch" (the "item") of the tree, and the branch itself uses the "list" field to set the order of display for it's "children"). Also notice that I have different handling for "shift-drop" vs. regular "drop".
While this isn't exactly what you are trying to do, perhaps it will give you some clues that help you find the right direction...
enjoy,
-e