2) In addition, is there a way to know if other processes are using the database?
The correct way is to simply try your operation (you can choose to use a timeout) and Check whether it is successful.
1) Is there a pragma or any way to understand the current lock state of sqlite db?
2) In addition, is there a way to know if other processes are using the database?
About #1: No, because the answer you get will be invalid immediately (that is, if you get the answer “No database is not locked”, others may appear and immediately Lock it and leave you with bad information).
The correct way is to simply try your operation (you can choose to use a timeout) and see if it succeeds.