Final edit: The problem was actually that I was using the wrong gnuplot binary. It works "headlessly" fine even with no one there to press confirm. So no need to export GNUTERM. See my other question for more details on the gnuplot binary.
Old Answer:
export GNUTERM=dumb
This tells gnuplot not to ask the user for anything and just run. I think it should be on by default but whatever. I set this env variable before running my scripts and they just run now without asking for input.
Edit: while it solved the problem, it seems like this doesn't actually do what I'm saying it does. Apparently this just tells gnuplot to plot in ASCII format? It still outputs my pngs though.
Double edit: It may have been all due to using the wrong gnuplot binary actually.