This has everything you need to know about wallet encryption:
github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/READMEI use the walletpassphrase to see if I still can remember my password and I don't want to transact, so im curious about what goes on when the GUI unlocks it when making a transaction.
If you need to do that, you can set a timeout of '1' second so your passphrase wont stay in your RAM for too long.