I have tested it a bit and I don't think it can be written to a .txt file cleanly. Something that does kind of work is:
raw 006:*:{
if ($left($2,1) == $chr(96)) { write map.txt $str(.,%indent) $+ $2- | inc %indent }
else { write map.txt $str(.,%indent) $+ $2- }
}
raw 007:*:{ unset %indent }
This adds periods (.) to the beginning of the string according to how man sublink tokens (`) it's encountered.
Edit: you can try replacing the . in $str() with $chr(32) but it will probably not work.