Hi,
Scripting and project variables are different variable types, and they behave differently. In general, it's up to you to choose which are more convenient in your case.
As for advantages, as an example, project variables can save their values between test runs, and you can assign different values for different people which access your project via network (this may be needed, for example, to store machine-specific paths). Also, project variables are available everywhere in your project, and you don't need to include units into each other to access them.