When you're qualifying for loans, they're not really looking for how much cash you have in the bank, they're looking at what your DTI (debt to income) ratio is. So using your available cash to purchase a new roof won't really effect what you get approved for with a loan. Buying a new roof with your HELOC will as it would then be considered debt.
That being said, a roof is arguably the most important repair to NOT delay on a house. Water ingress = many many other problems you'll have to fix down the road and more money you'll waste. If I was in your situation, I'd use my cash on a new roof (assuming you have all the cash for this and won't need to finance?) which will slightly increase the value on the house and potentially increase your HELOC as well. Then, use the HELOC to invest.
If you also need more help from the forum, it's best to post as many numbers as possible. Do you know how much your new roof will cost? How much cash you have? How much equity in the house you currently have for a HELOC? stuff like that gives us a more accurate picture to respond to :)