You can achieve this by creating and "Exit event" in parent task, set scope to subtask and set propagate to yes. Inside of this event raise event Quit (or exit ... quit also fires F2 i belive so you wont get stuck on any errors if you have controls on fields).
Now pressing esc in subform, will close the whole form ...
And for the exiting of subform back to parent form look at what Tood Baremore suggested.