There are two static and multidimensional arrays in that section of the code. $aN defines specific array-attribute pairs using key-value pairs like 'rel'=>array('a'=>1) which indicates that 'rel' is allowed only in 'a'. To allow in 'div' as well, one will modify it to 'rel'=>array('a'=>1, 'div'=>1). To allow in all elements, modify instead the $aNU array which specifies universal attributes and possible exceptions. Thus, to allow 'rel' in all but 'script' elements, one would use 'rel'=>array('script'=>1).
To allow custom, non-standard attributes, the rules are similarly defined. htmLawed identifies attribute names using a particular regex pattern, so unless that is modified, custom attribute names have to start with an alphabet, contain at least two characters, and can only have alphabets, colons (:) and hyphens (-).