Thank you very much for that, just in case anyone else is searching for the same thing, this is the code i'm using to detect if blocks are added to a page.
Thanks for your help Tim!
$block_manager = $PAGE->blocks;$block_manager->load_blocks(true);
if($block_manager->is_block_present('block_name')) {
echo "Found";
} else {
echo "Not Found";
}