Perhaps an external simple mixer with 2 inputs (micro & line-in) and 1 output (line-out) will likely solve the problem.
But this is just an idea. I am not expert in audacity or in audio recording/editing.
Edit:
I just read this post:
https://forum.audacityteam.org/t/record-doesn-t-drop-to-next-track/52085/1
Its problem seems being the exact opposite of the one here