You suggest to use WinSCP in command-line mode. Yes, but what is the command to store sessions ? I can't find it.
It looks like you've completely missed the point :-)
I've suggested you to create the sessions with your script as you've originally intended to do. Just make it to store the passwords unencrypted (using 'PasswordPlain'). Then run WinSCP once (anyhow) to make it encrypt the password. Only 3.8 can do that. But you can use it just for the encryption and keep the stable version for actual work.