Is it a good idea to use a VPN before sending a transaction via an online wallet to preserve your IP address?
An online wallet wouldn't make much of a difference -- they are the ones whose IP would show up on the blockchain, afaik.
There are no IP address on the blockchain. What migh refer to are the IPs shown by
blockchain.info a service. Its the IP of the full node that told them about the TX and most likely has nothing to do with the person the issued the TX.
To hide your IP from a service you can use a VPN, yes.
There's other ways to track who pushed a transaction as well, so blockchain, in this sense, is still valid (i.e., while it's not published publicly within it, it's still available).