1) I think there's something wrong with your greater than and lesser then signs... Basically they re the same for boths side. I m just guessing cause i fdont know what "HiddenCudeLeft" and "HiddenCubeRight" is...
if (enemytransform.transform.position.x >= HiddenCubeLeft.transform.position.x)
else if (enemytransform.transform.position.x >= HiddenCubeRight.transform.position.x)
prob should be something like
if (enemytransform.transform.position.x >= HiddenCubeLeft.transform.position.x)
else if (enemytransform.transform.position.x <= HiddenCubeRight.transform.position.x)
2) This is prob the problem with it runing all over the place.