The script you wrote does not put the password into any easily accessible long-term storage (like a file). Even if typical linux auditing would be enabled (which would write all unix program invocations to a log file, including arguments), the password is not visible, as it is only passed via streams. The only exception is the "echo" command, which happens to be a shell builtin on bash, so it is not a "unix program invocation".
If the script finished, the memory allocated to
$PASSWORD is freed, and if another processs happens to allocate that memory, it will be cleared before. But the memory used for "$PASSWORD" (or the copies made inside chpasswd, the echo builtin, the graphics library to display the password) is not necessarily cleaned after termination of that script. If you happen to use a GUI with a console window, the password obviously is in memory as long as you can scroll back to it. Depending on security settings in the kernel, root processes might be able to search the whole physical memory or swap space for copies of the password, but any program allocating memory via the kernel is guaranteed to not find the password in there, because the memory will be cleared before it will be handed out for another process.
If your computer has plenty of memory, or the password ended up in swap space, it might be around for along time after you script finished. Having no swap (or disabling swap and clearing the whole swap partition/file) prevents the password ending up in the swap file. Allocating and overwriting lots of memory can clear the password from memory, but is a dangerous thing to do on linux because the OOM killer which will kick in just as you can be sure you have overwritten all memory that might contain the password might kill some unrelated process.
If you need security against memory scraping, the password generation would have to make sure that the password is never copied to uncontrolled memory, and the controlled memory is cleared before the program exits. There is no way to do that in shell. I think the is even no way to display a password (short of writing it to video memory yourself) which is 100% guarantueed of not copying the password to some random memory.