It's almost impossible to work on the text documents becasue they lack any kind of structure (most lines seem to be combined into one statement.)
It's important that this section of code:
select case Request.Form("Method_Type")
case "login"
...
case "logout"
...
end select
...stays in the inc_header.asp file, as this code will be executed when logging in or out whatever page of the forums you are on.