"position == closed" is the problem. That's a non-trivial calculation. And it is just the tip of the iceberg for this topic. You can't check against every possible type of pattern, and it is hard to figure out which patters are relevant until you have checked them.
That is the whole point. Patterns don't have to be trivial. They can be generalized. You have to check for certain pieces, on certain squares, and flag it as closed. Then do something about it. Starting with basics, and adding to the number of patterns is what would have to be done.
Defining what it means to have a closed position isn"t that hard...
Check for open files and maybe count them to determine true or false.
Check pawn structure.
Increase value of knights for closed positions.
Flag opening book line possibly even...
The only problem I see is that the speed of the search will be a bit slower, if it has to keep checking to see if the position search is closed or any other pattern of pieces on the board.
It doesn't have to be too much different than determining an outpost for a knight, a bad bishop penalty, or even your tropism scaling can be introduced if a certain set of rules occur