If your NS ESA ends on completion of the 12 month payment period, you should ask the DWP to continue to assess you as having a limited capability for work. This will allow you to be credited with national insurance contributions.
We would advise you to seek help from your local Welfare Rights Organisation; advicelocal.uk they will be able to take all your circumstances into consideration.
Gary
Nothing on this board constitutes legal advice - always consult a professional about specific problems