Here is a scenario:
I would like to load another vimscript file into my script(via :runtime! command), and have access to script scoped (s:) variables and functions that are inside loaded file.
Is it possible (without altering file that is loaded)?
Unless the script exposes a function for that purpose, I'm afraid that it won't be possible to access script variables.
For instance, all my autoload plugins have a function such as
function! lh#dict#debug(expr) abort
return eval(a:expr)
endfunction
However, it's perfectly possible to access script function through a very dirty trick.
But, honestly, you'd better ask the script maintainer to open his/her script for your need(s). You need first to obtain the script id (this can be done by parsing the result of :scriptname through :redir command or through the recent execute() function.
" or if your prefer, if you're looking plugin foobar.vim:
let snr = matchstr(matchstr(split(execute('scriptnames'), "\n"), 'foobar.vim'), '^\d\+')
Let's suppose the 42nd script loaded defines the function s:foo(), you can access to it with:
let Foo = function('<SNR>42_foo') " or, use snr variable obtained as explained above instead of 42
echo Foo(42)
'\(^\s*\)\@<=\d\+' works better than '^\d\+' because there may be leading whitespace.