Can you record the current level using awk and alsamixer sget to a file, like the PID, just before you set it to 100. Then restore it when you do the cleanup up the end.