Can I see if/when someone opens Messages on my Mac?
There are a number of applications which let you create macros and scripts and trigger them in various ways. I have the most experience with Keyboard Maestro, so that's what I used for the example macro below. However, as Tetsujin commented, simply password protecting your computer probably makes more sense from a security standpoint; there isn't really any reason someone else should have access to your account.