You cannot access the script name from gnuplot, but you can give a parameter when calling the script, which should work fine, especially when using Makefiles.
%.pdf: %.gnuplot
gnuplot -e "scriptname='$<'" $<
In the plot file, this could be used with a command such as:
set output scriptname
Or from the command line:
gnuplot -e "scriptname='my_plot.gnuplot'" my_plot.gnuplot