Your tax savings is above what you'd get with the standard deduction, times your marginal tax rate. At the 25 or 28% tax brackets this lets you write off somewhere around $100-120/month... math left as an exercise to the reader.
So you still have to come up with a couple hundred a month. Dividends grow 4%/year or so, but mortgage interest will decline (takes longer).
BTW $100K is exactly the limit of how big a HELOC you can deduct for non-house purposes. The deduction doesn't scale at $500K say.
A lot of talk about tax reform right now relates to limiting the mortgage interest deduction, and you're hoping tax laws don't change over 30 years anyway.
Say you did this in 1999-20 when the S&P was at 1500 (not even the high back then). You'd be about $56K ahead on the SPY (666 SPY * $235). Average dividends would be *very* roughly $2k/yr ($1k then, $3k now), HELOC payment net of interest might be $4k/year so some $35K behind from carrying cost -- that's not the exact number but it's the ballpark. So some $20k ahead overall or 1%/year nominal (1%^17 = 18.4%). I think best case wouldn't be much more than $40K ahead if say you refied at the bottom.
You'd be near flat or slightly behind in real terms... doing it in 1999/2000 is probably the worst case scenario and assumes you stayed solvent through 2008.
Extra Credit: Instead of SPY, buy MO in early 2000 and figure return. Yielded 8% at the time and has split into four companies since. (AAPL was all over the place in 99-2000, but say you got in at $50, so 2000 shares but no dividends. That would be 28,000 shares now at $143 or $4 million, but higher carrying cost.)