You don't need much scripting for that. I am not familiar with mpg123, but the general idea if you use bash as your shell would be this:
Code:
for file in *.mp3; do lame --decode "$file" "${file/.mp3/.wav}"; done
Change "lame --decode" by whatever you want. I prefer to use lame just because I am familiar with it.