To get to Whitby by train from London, go to Kings Cross and get a train to Darlington (usually LNER) and then one to Middlesborough, from there you can get a train to Whitby. Getting back from Scarborough is easier as you get a train to York and then one to London.
As for the walk, Robin Hood's Bay is probably the nearest to half way and has plenty accommodation. Ravenscar is about the halfway mark and it has a Hotel but it's pricey. A regular bus service runs between Scarborough and Whitby passing through Robin Hood's Bay so you could stay at either of them and then get the bus to and from Robin Hood's Bay at the end of the day.
I guess it depends how far you want to walk each day.