Welcome to the forums!
I cant tell you why it works when you comment that line out. This is mostly due to me not knowing what exactly you mean with âworkingâ. Since line 30 controls your logic for whether the coin is landed or not, i imagine when you comment it out the bool wont ever change. Which to me cant be called âworkingâ 
There is a lot you can improve with that code. From actual game breaking problems, to conveniences and conventions to make your life easier. All of this is fine of course, since you are still learning. Here we go!
Rotations in Unity are stored as Quaterions. A quaternion is a four dimensional construct in the complex number space, which is for certain reasons really good at handling rotations in 3D space. It is for these reasons used in computer graphics and⌠quantum physics. Needless to say, Quaternions are pretty darn complex, and i would say that only a hand full of people globally actually know on a fundamental level how its x, y, z and w component relate to each other. The point here is that rotation.x is not what you think it is, and comparing to or working with it directly is usually not intended. When you need to work with actual rotations, you dont need to know how Quaternions work, as Unity provides a bunch of functions you can use: Unity - Scripting API: Quaternion
When you need the rotation in euler angles you can simply use rotation.eulerAngles.x and so forth.
Due to floating point imprecisions it is usually not a good idea to compare floats using â==â. Internally the float will rarely reach a precise number, and will rather often end up at 0.0001 or 89.999998. You thus want to know if two floating point values are approximately the same: Unity - Scripting API: Mathf.Approximately
As for your flipping mechanic, you said that if you comment in line 30, it goes from true to false while spinning. While we already went over rotation.x being the wrong thing to use here, a spinning coin might inevitably at some point of its spin reach the rotational value you intend to check for. So just checking the rotation to determine whether it has landed is not good enough. I dont know how you spin the coin.
If itâs physics, you can simply check the velocity and altitude over the terrain to determine whether it landed.
Thatâs it about the more critical problems. Letâs get to the conveniences and conventions!
You never need to compare bools to true or false. If we have someBool, then someBool == true
is the same as simply writing someBool
. Both statements evaluate to true only if someBool is true. If you want to compare to false, then instead of writing someBool == false
you can write !someBool
(read: not someBool) instead. This is shorter and less prone to mistakes.
You do not need to use else if, if no other outcomes are possible anyways. If you check if (variable == 0)
, then if that is false, that already means that variable must be not equal to 0, thus you can simply write else instad of else if (variable != 0)
.
Again this simply improves readability and reduces code complexity, and with that the places to introduce bugs.
Last but certainly least, we have a shortcut for writing +=1 specifically, you can simply write ++ instead.
Hope this helps 