Finally! I did it! (Not that it required very advanced sollutions...) Thanks hugo and Styno for your time. The main sollution was to replace the increment line in the delay script with

: $((i = $i + 1 ))

Also did the check on the file stupid-ftpd.conf, that is I delay the boot until this file exist. The whole script follows..

i=0
while [ $i -le 30 ]; do
if [ -e /tmp/stupid-ftpd.conf ] ; then
killall stupid-ftpd
cp /tmp/local/etc/stupid-ftpd/stupid-ftpd.conf.aon /tmp/stupid-ftpd.conf
stupid-ftpd
break
fi
sleep 1
: $((i = $i + 1 ))
done

A security issue might be that if the script for some reason times out (although 30 secs should be enough), the ftp deamon may run with the default stupid-ftpd.conf which enables anonymous access. I'll see to adding some code that, if file /tmp/stupid-ftpd.conf is not found, kills any stupid-ftpd running ("killall stupid-ftpd") and unmounts any connected USB-drive ("umount /tmp/harddisk").