Is there any protocol for proving that a message was written at a certain time? Does there exist a way to cryptographically prove that a message was written at a certain time? I know that one can write messages in bitcoin transactions to that the message is preserved in the blockchain, which can be used to prove the message was written at that time, but I'm wondering if there is any protocol that exists specifically for the purpose of proving the time of a message.
In general, no.

You can prove a message was written no later than time T by hashing the message with a collision-resistant hash, and communicating the hash to some trusted third party that records it was aware of the hash at time T. The bitcoin blockchain can be used as a third party here. You don't need to put the whole message in the blockchain, just a hash.

You cannot prove a general message was written no earlier than time T. If there was an alleged way to prove that, you could just write a message earlier than time T, wait for time T, and perform the alleged proof, tricking any verifier.

If you can communicate back and forth with a verifier, you can prove you are writing the message during the communication, by hashing your message along with some random data provided by the verifier and passing the hash back to the verifier.