If you're buying or refinancing in the next six months, your line of credit balance stops being a strategy question and becomes an underwriting question.
Underwriters calculate debt-to-income using the monthly payment on your reported balance. A line sitting at $30,000 with an interest-only payment around $200 adds $200 to the debt side. Carry it at $2,000 instead and the number nearly disappears. Same strategy, different snapshot day.
Some lenders go further and count the full available credit line rather than the drawn balance, on the theory that you could max it tomorrow. That's less common on a HELOC than on a credit card, and it isn't something you want to discover at underwriting. Ask the loan officer which method they use before you plan around it.
Credit score matters here too. A line reported as revolving credit with high utilization drags the score the same way a maxed card does. If it reports as a mortgage instead, utilization usually doesn't apply. Pull your report and see which way yours shows up, because it varies by lender.
Recent large deposits get questioned too. If you drew $15,000 off your line of credit and it landed in checking, an underwriter will ask where it came from and will treat borrowed funds differently from savings for down payment and reserve purposes. Keep that activity separate from the account you're going to source funds out of.
The practical move is to pause your chunking about two statement cycles before you apply. Let the line of credit report a low balance twice, get the loan closed, then go back to running it. Two months of paused chunking costs very little against a rate you'll carry for thirty years.
Don't close the line of credit to clean up the application. Closing it drops your available credit and can knock the score down at exactly the wrong time, and reopening it later means a new application, new fees, and a new appraisal.