Actually there are missing parenthesis in the original version - it should be 

if ((JRequest::getCmd("task") == "icalrepeat.detail" && $params->get('showindetails', 0) == 0) || JRequest::getCmd("task") == "icalevent.edit" || JRequest::getCmd("task") == "icalrepeat.edit")