Good idea to move to opt, however I think this will make the script fail when it attempts to create the /opt/[log|data|db] folders, as it will attempt to do that with the user `vagrant`.  To make sure they are created anyway, they should probably be created here.

Also, I think the folder `/edx/edx-platform` is already owned by `vagrant`.