My Unity Editor crashes when i try to enter playmode

when i press play it says application.playmode in a pop up window and then it continues forever until i end the task entirely. i think it is an infinite loop problem with this script

my script is meant to randomly generate a building with enemies so you can shoot it with a bird like in angry birds.

i think the problem is in this because when i dont check for a tag and just check if it isnt null it works.
raycastHit is just a raycast coming from the middle of the block.

>                 // blocks and the ground has the tag Ground
>                 if (raycastHit.collider.tag == "Ground")
>                 {
>                     isGrounded = true;
>                 }

@AbandonedCrypt @logicandchaos

It probably has to do with your while loops, if your loops appear infinite then unity will crash.