Well, if it is an actual structure then you can use the chunk providers' isInsideStructure() and getNearestStructure() methods to help you.
If you just need a pattern of blocks, then you just have to write the code to look for the pattern. If the pattern is relatively simple, that shouldn't be too hard although you'll have to consider the various rotations possible and check for them all.