Using window variables instead of script variables simplifies the code quite a bit. Remove the BufDelete autocommand since it gave problems. Its usefullness is debatable anyway. Thanks to @jceb for his pull request demonstrating the use of window variables.
When starting Vim as follows: 'vim a b c', the files a, b, and c were added to the buffer navigation history in the wrong order. The user had to use BufSurfBack to navigate to the buffers for files b and c. Now, a is in the initial buffer, and issueing BufSurfForward navigates to the buffers for file b and c respectively.