That's not a script, that's Construct code in pseudocode. You can re-create it with events on the event sheet.
You will need to use a family to allow picking two instances of molek independently in the same event, and then to check if they overlap each other.
This event won't work because the same instance of molek can't be attached and not attached at the same time:
Molek is attached
Molek is NOT attached
Molek overlapping Molek
That's why we use families:
Molek is attached
MolekFamily is NOT attached
Molek overlapping MolekFamily