Gunman seeking revenge for 'humiliation' by security personnel fired rifle at building's doors last week, according to investigators