1. You can continue to pipe commands through bluetoothctl (remove the pairing and agent commands), but remember each connection will cause bluetoothctl to start, load a default agent, perform your command, and then stop, ending any agent also. You can stack up commands, it's not the best way.
2. In Python you can use the pexpect library, a much more elegant way to interact with a CLI. Google knows about it.
3. Or use the Bluepy library to scan, connect, and read/write characteristics directly in Python.
There are other ways. I prefer #3.
By the way, your device is using the nRF(Nordic) UART service, I don' t recall seeing a Python library for sending/receiving that, but you should look for one. It wiil give you a large boost. Or rewrite various C implementations.
[EDIT: I did find this:
https://scribles.net/tag/nordic-uart-service/]