Yes, it can stay in such a space.
The shadow, or presumably other amorphous monsters, can stop while moving.
Your DM might want to do some worldbuilding here.
Like many things about 5e, the details are left for the DM to fill in. Is it comfortable for the shadow to wait like this? Is the shadow smart enough to think of this tactic? Does the shadow incur any risks, for example if an adventurer puts a rock in the crack so it's no longer large enough for the shadow to get out?
Some DMs might rule that, even if an amorphous creature can pass through a thin space, its volume doesn't change -- so it might need a very deep crack to hide its full body in.
The shadow was even worse than this in edition 3.5.
The shadow used to have the incorporeal subtype, which let it hide in the floor:
An incorporeal creature can enter or pass through solid objects, but must remain adjacent to the object’s exterior, and so cannot pass entirely through an object whose space is larger than its own. It can sense the presence of creatures or objects within a square adjacent to its current location, but enemies have total concealment (50% miss chance) from an incorporeal creature that is inside an object. In order to see farther from the object it is in and attack normally, the incorporeal creature must emerge. An incorporeal creature inside an object has total cover, but when it attacks a creature outside the object it only has cover, so a creature outside with a readied action could strike at it as it attacks. An incorporeal creature cannot pass through a force effect.
Hiding in a crack is pretty mild by comparison.