If you want to script it, ImageMagick or GraphicsMagick are probably a better bet than trying to hack up something with GIMP batch processing: http://www.imagemagick.com/www/formats.html
If you just want to do basic conversion ignoring layers, it's quite easy:
for f in *.psd; do
convert "$f" "${f%%.psd}.png"
done