How to locate the position of the text cursor

Hi guys, last time I thought the note taking software I was using was not working very well, I switched to another note taking software called obsidian, which allows formatting through plain text instead of copy and paste, but at the same time I am having problems with how to position the cursor to where I want to type after the final insert, which is on the second line, Another similar question, is how to position the cursor to the top when I start to trigger the macro, both questions should be similar methods, I have tried some methods myself, I have tried to make a mark where I type, such as the ">>" symbol, and then replace it by a blank, but found that the cursor is still at the end after the replacement I don't really want to use the arrow keys to do it, because it's still a lot of work and I have to type a lot of arrow keys, thank you all for your replies, your help will be appreciated!Screen Recording 2021-11-22 at 13.19.15
input test Macro (v10.0)

input test.kmmacros (4.4 KB)

After doing my own research and finding what I could use, I still have to use shortcuts to do it, although it seems complicated, But I can't seem to find any other way.
test Macro (v10.0)

test.kmmacros (8.0 KB)