Take a look in this node "
Foreach & scalar ref: break of way that it is suposed to work!". I put it there to make a discussion about it. You can see a code of how to write/read to a scalar variable and affect directly the value of a key too (without Tie). And why what you want to do doesn't work, and shouldn't work...
Graciliano M. P.
"The creativity is the expression of the liberty".