It won't work in this situation. Multiple commands here are separated by newlines (like pressing enter on your keyboard) and putting # will only comment out the first one.
Yep, you're right. This one had a " char on the second line that made me confused. A heredoc will still work though, I should start doing that instead :)