You can input code via the monitor but not the Arduino IDE serial monitor, the Arduino IDE is used for c\c++ .
Also you need a monitor/terminal that recognizes and responds to Ctrl A CtrlB CtrlC CtrlD , this keyboard input does things like break enter Raw REPL , exit Raw Repl reboot etc.
Give a simple example of what you would like to see so we can see if it is possible.
Which IDE do you use for Micropython.