For me the 'disappearing script' is a nuisance, but not big deal, as I only have one Import and now only one line of code. But in other circumstances, it could be a real pain.
As suggested, I added some code to create a log entry at the start and finish of Script code sections. And again hit the issue of deploying it and then the version mismatch.
So I re-installed the SSDT tools into VS and checked I was still deploying to SQL Server 2016 and re-deployed the package.
Now everything seems to be working exactly as expected.
Tim