An Inverness-born Royal Navy engineer will run 500km - nearly 12 marathons - for charity while aboard HMS Queen Elizabeth.