The %% can only be passed to commands which accept a job id. You should probably read the bash man page or the advanced bash scripting guide. They both explain a little more about this.
Here is a simple script which I just wrote which waits for a command to complete and shows it's progress by displaying a period every second. It uses $! which contains the pid of the last process started in the background. And uses the ps command to see if this process is still running.
sleep 10 &
echo -n waiting
while [ -n "`ps --no-headers $!`" ]
echo -n .