How to condense (make more efficient) coding with port manipulations?

Nope, none of them do Arduino Programming. So I'm kinda alone to do it.

Ah, but you ought to be at a point where help with C/C++...
A lot of what we're talking about (building up a string and looking it up in a table) is not Arduino specific.
(You might even find some help in a data structures textbook - see "symbol tables.")