I have always been of the opinion that there should be minimal jumping around in the text when moving the caret. It makes it so confusing to work with a mixture of RTL and LTR text.
This is the approach, even though it is not very standard, that I would take.
Start with the cursor at the beginning
If you press the right arrow key, move the caret right.
This makes it so that there is no jumping and the arrow keys behave sensibly. Even if I am reading from right to left, the left arrow should still move me left in the text and the right arrow should still move me right in the text. Selecting text should behave the same way.
If I add a new character, if I am in LTR mode it should append a character to the right of where the caret is and then move the caret right. If I am in RTL mode, it should append a character to the left of where the caret is and move the caret left.
If I press Enter, if the text on this line is aligned LTR, all the text to the right of the caret should be moved to the next line, and if it is aligned RTL, it the text left of the caret should be moved to the next line:
peacم //Enter is pressed
Enter is pressed\\ cسلام
If the line is in LTR mode, Home and End should go to the very left and to the very right of the line, respectively. In RTL mode, they should instead go to the very right and very left.