Hmm, if the script is just a series of open commands it's weird that you are having issues as root (no errors displayed?). With problems when you save you mean that you don't have the required permissions(e.g. files owned by root or other users)?
A useful alias if you need root permissions to save:
I made a script that opens all the files I need. I call the script with: :source scriptname.
Only problem is that the script works only if I open vim with 'vim' and not with 'sudo vim' (by the way, why is that?).
Based on what you've said, I'm not sure if this is an sudo issue or a vim issue. Where is scriptname, and where are the files that scriptname references? Your sudoers may be set up to replace the environment in such a way that vim looks relative to root's home directory rather than your user's home directory. You may need to copy your ~/.vim directory to ~root/.vim, if ~/.vim is where you've put scriptname and the other things it loads. Or you can move these into a system-wide path that vim searches.
It might be worth running :cd in the sudo vim instance and in the regular one. Your sudo current directory could well be different to your own which would explain vim not being able to find the script.
You might try using sessions instead.
In my vimrc, I have this line:
nnoremap <Leader>q :mks!<CR>:qall!<CR>
And in my .bashrc I have this line:
alias vv=vim -S
Once you have all the files you want open and arranged the way you like, save it all and then hit \q to save the session and quit. Then, instead of vim, use vv to go right back to your session. That's how I do it, anyway.
I made a script that opens all the files I need. I call the script with: :source scriptname.
Only problem is that the script works only if I open vim with 'vim' and not with 'sudo vim' (by the way, why is that?).
But if I open with 'vim', then it give me problem when I try to save...