How can I "unsplit" (ie reconnect) vertices that I split (not separated) from mesh in edit mode?
I think you are overcomplicating it way too much. If you only want the shape that you uploaded a picture of, it can be done in just 2 steps:

1: Inset the top face of the cube by pressing I.

2: Extrude the inset face up by pressing E.