I appologise for formatting but writing from my phone, but I presume your working with xna, you should have your game states in a switch statement otherwise your code will get messy very fast as well as inefficient
Switch(currentgamestate)
{
Case gamestate.loading:
If(pressing escape)
Currentgamestate = gamestate.mainmenu;
Break;
Case gamestate.mainmenu;
//todo
Break;
}
Your error is because you are trying to link two conditions together ..if currentgamestate isnt loading and is main menu, you need to reference current gamestate for each condition.. if currentgamestate isn't loading and currentgamestate is mainmenu