How to enter validation for a choice of a question in Google forms using script editor?

I want that when someone tries to fill the checkbox, the checkbox automatically unchecks itself according to the time of the day.

Here is my code:
`

function myFunction() {
  var myForm = FormApp.getActiveForm();
  var title = myForm.getId();
  var choicesArray = [];
  var item = myForm.getItemById('xxxxxxxx').asCheckboxItem(); // xxxxxx is whatever the id is 
  var choices = item.getChoices();
  var d = new Date();
  choices.forEach(function(a) {
      if (a.checked == true && a.getValue() == "First")
          if (d.getHours() >= 17);
          a.checked = false;
      if (a.checked == true && a.getValue() == "Second")
          if (d.getHours() < 17);
          a.checked = false;
  });
}

`
After creating trigger nothing happens and i am able to select both the checkboxes which shouldn’t happen. Nor the trigger triggers.

if that is not possible then how to delete the second choice and only show the other one?