[V1 plain form (present)]-ようにV2 expresses a purpose, the part before ように describes a desired state or situation the actor of V2 intends to achieve through that act. V1 cannot be an intentional act by the same actor as V2, as in the case of
[V1 dictionary form]-ためにV2. In that sense, translating
[V1 plain form (present)]-ようにV2 as “V2 (in order) to V1” is not quite accurate. It might be translated as “V2 (in order) for S1 to V1” if the actor of V1 is different, or as “V2 (in order) to be able to V1” if V1 is a potential verb, though.
For your sentence to be understood as expressing a purpose like that, it would have to be read in the following way.
First of all, V2 cannot be 聴こえてきた because it is not something you do with a purpose. (It is not something you do. Period.) Then, V2 must be ノックする, and the subject of 折る, as V1, must be someone or something other than the person knocking the door. It could be either the speaker himself, with 自分 working as a reflexive pronoun, or the sound of the knock, in which case 自分 sounds a bit odd unless that’s how the speaker refers to himself. (This character seems to use 俺 in the novel.)
To me, this interpretation seems unlikely because the speaker wouldn’t have known what end state the person behind the door intended to achieve when she knocked the door, or she wouldn’t have known that the speaker was going to begin something inside the room for her to purposefully interrupt. It seems more natural to understand this ように as simply expressing the speaker’s impression that either the sound itself or the way she knocked the door seemed like it had the effect of breaking the flow of his thought.
In any case, it is either one of the two. It is just that when the speaker’s impression is about someone’s intention, the two seem to overlap.
I don’t understand why the author chose to use 自分 instead of 俺 here. The choice of 聴こえる, instead of 聞こえる, is also odd. Besides, 腰を折る in this figurative sense is not usually used outside of the fixed phrase 話の腰を折る.