How to Check if Script is run once device is booted?
mkshrc is by definition run every time an interactive shell is started, so it’s the wrong place.

You really should hook up your script with Android’s init system instead. (Sorry, I can’t give details on how to do that; I don’t know the Android ecosystem well, I’m just mksh’s developer.)

Writing to a file in tmpfs (so it’s auto-removed on poweroff) is usually a good approach for a script to run only once. However, I’d be surprised if Android’s init system wouldn’t provide such a facility; it’s the ideal tool for your job.