It is possible, but some of the tracking would require a trusted function, which is difficult to deploy and maintain.
Tracking when the form is opened is easiest. You can use the doc:Ready event, because this only fires once. There is kind of an example here https://acrobat.com/#d=06u-J6N34PQdaD25ZCPrSA, where objects are tracked, it may give some ideas for the docReady event.
There is a docClose event, but I think this fires after the form is closed, so you probably won't be able to write this data (time) to the form itself.