What piece of code would allow me to check if a block has been found then run an operation?
You could simply record the value of bitcoind getblockcount somewhere and see when that changes by calling getblockcount repeatedly.