First check ZetaDia.IsInGame.
Then to determine if your in the main menu.. use UIElement.
To get the hash of a button (i.e. Start Game) hover over it and hit alt-8 and it will print in demonbuddy.
After you got the Hash, then you can use UIElement.FromHash().
Then using the UIElement you can check using logic: uie != null && uie.IsValid && uie.IsVisible;
If it returns True.. then you will know if your in the main menu!
However if you are trying to run the Bot.. it may be better to insert a hook into [OutOfGame] treehook. By inserting a new decorator at the beginning you can do all kinds of things before demonbuddy tries to make the next game. Although this will not necessary tell you if your in the main menu, just that your not in game!