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
Gimp's support for PSD is understandably poor for the more advanced/modern features, so I wouldn't rely on it without being able to compare the output to something else. I use Apple's Preview utility to manually compare results.