I am starting to look into this and will keep this post up to date as I learn more about it. Please don't take this as anywhere near gospel. I probably did it all wrong.
Assuming you have nothing special going on in your tax life:
taxPerNormalMonth = Tax you pay every month shown on payslip or you can find it on the website linked to in my Notes section
Refund = (taxPerNormalMonth x migrationMonthsWorked) - (taxPerMigrationMonth x migrationMonthsWorked)