function getLogin() {
  var username = ... // なんらかの処理
  var password = ... // なんらかの処理
  GM_setValue("username", username);
  GM_setValue("password", password);
}
function autoLogin() {
  var username = GM_getValue("username", -1);
  var password = GM_getValue("password", -1);
  if (username == -1 || password == -1) {
    getLogin();
  } else {
    // ログイン処理など
  }
}
