Your question is market timing dressed up in some other words/form.
Are you a good market timer? (Probably not.)
If you’re asking whether it’s better to pay off the loan, using investments, in order to free up cash flow in order to put back into investments, I’d look to whether your investments expected return is higher or lower than the loan interest rate (including insurance if you’d drop insurance once the loan is paid off) on a post-tax basis. If your loan is under 4%, it’s probably better to keep paying the loan rather than pull money out of investments only to gradually put it back in. If it’s over 9%, probably better to pay it off. In between, take a closer look.