Maybe this will help, http://lee-mac.com/ssget.html, looking towards the bottom and the 'or' option, you want to select entities that are blocks OR lines (use the description in the AND box above for a good example, changing it to OR of course)
If your code is working nicely though a bit long, not changing anything that works (always good...) this https://www.afralisp.net/autolisp/tutorials/selection-sets.php has a description of how to add 2 existing selection sets together (about 2/3 of the way down the page, creating a 'union' between selection sets). Not sure what happens if an entity is in both sets, probably will exist twice in the new selection set and be processed twice subsequently.