about 1st question, no its not a bad approach usually that kind of checking is left outside of the jade document for keeping the document in a clean state.
you can try to expose Objects to res.render
which makes available the data to document. so to avoid much of the javascript code in jade template just expose a user object.
var user={loggedIn:false}
about 2nd question, req
, res
are passed on each time , by express using the middleware pattern, until a res.send
or res.end
or res.render
(and other) are called which stop the execution of middleware stack.
a simple example would be
app.get("/",
function(req,res,next){
req.hello=world; if(next){next()};
}
,function(req,res){
res.send(200,req.hello);
});