The sentence in question is:
相手の話の途中で話を始めるくせがあると、人に言われてはじめて気がついた。
I understand the meaning of this sentence as "I noticed my habit of interrupting people until someone told me", my question is, the と particle, what function is it playing here? is it a shortened という? It doesn't seem to be the usual "when X then Y" or "AND".