I'm a bit worried about a potential scratch to my d7000 sensor as shown in the rather grainy image below.
Scratching the sensor itself is unlikely to happen. The sensor itself is typically behind a (hard to see) element that acts (in part) to shield it.
However, upon reducing the aperture the line becomes more blurry which is indicative of a dust spot and NOT a scratch. Is this correct?
The reason why you see dust spots showing a different size at different apertures is because what you're actually seeing is the shadow of the dust which is on the "shield", not directly on the sensor. If it was directly on the sensor it would always be the same effect.
Note the black line in the top left. It is more of a fine line vs. the 'spots' I've seen in the past, hence, my worry.
It's a fine piece of fiber or hair or something like that. It should come away with cleaning, but may require more than the in-built system on your camera.
There's a detailed article on the various stages of sensor cleaning on Thom Hogan's website.
I've spent the past week photographing a lot of beach and sandy locations but I have not at any time removed/switched lenses during this time i.e. I've never exposed the sensor.
This is a misconception a lot of people have.
Most lenses are not sealed and the lens mount itself is not fully sealed in most cases (sealed lenses typically use, at a minimum, a small gasket ring on the mount).
And zoom lenses are prone to suck in dust (because the lens is expanding and contracting in size. This means dust gets into the lens (not typically a problem in and of itself) and some can travel through to the camera body.
And of course the dust can predate the beach trips. It could have been inside the body or on the rear part of a lens previously and simply moved.