As you might expect this is a fairly rigorous procedure and details can be found on the good old DGT web site
here.
Among other things you have to show that the most recent circulation tax has been paid and I don't think you will get a refund.
There seems to be no mention of any documentation from the scrap yard to which you decide to take it but maybe they have to stamp the DGT form. It used to be that if you could drive the vehicle to the scrap yard you would get something for it even if it was only a few euros.
If the vehicle is more than fifteen years old DGT makes no charge for the paperwork.