Your guess (2) is as good as correct. *»Und dabei hatte ich gehofft«* could be replaced by

> Und hinsichtlich des eben Erwähnten hatte ich doch gehofft ...  
*(And concerning what has been said before I really had hoped ...)*