Strange behaviour of Target Display Mode with iMac, Mac mini and Thunderbolt display
This Apple KB article will help answer some of your questions:

Target Display Mode: Frequently Asked Questions (FAQ)

From what you're describing, I think what is happening is that the Thunderbolt Display is acting like a regular display for the iMac, while the iMac is acting as a TDM for mini. Thus, the signal for the mini ends up on the Thunderbolt Display (since it's considered "part of" the iMac).

At first glance, I'd say that TDM isn't intended for multiple screens, though I'm not sure...

To specifically answer 1. and 2. (from list item 14 in the link above): 


  [...]Other keyboard and mouse input is disabled on the iMac while it is in TDM[...]


This means that the keyboard and mouse need to be connected to the mini in order to work beyond presssing Cmd+F2 to exit TDM.

In regards to what happens when you exit TDM, that's probably just a side effect of the Thunderbolt Display being the last active display (Remember, 10.9 moves the dock to the display on which you're interacting. Makes the menu bar opaque, too).