It sounds like your setup spawns something else and doesn't wait for a return, as the shell command waits until completion before continuing. If you can't change the setup program stay open until all is completed, you might want to just build error checking into the delete. This could loop forever if your app never closes, so fixing the setup would be better, but... not all things are practical.
Hope this helps,
Steve

--------------
;Tests for presence of existing installation
$wfc = EXIST ("C:\test.ini")
IF $wfc=1

MESSAGEBOX("Already installed - Contact Administrator", "Test Deployment",0)
EXIT
ELSE
SHELL "I:\disk1\setup -s"

Do
SLEEP 3
DEL "C:\test.ini"
Until @Error = 0

MESSAGEBOX ("Installation Completed", "Test Deployment",0)
ENDIF