bitcoind API rpc calls to encrypt an arbitrary message and create a script
I would recommend that you use a purpose designed encryption tool like GPG to encrypt messages. If you need to bind it to a Bitcoin address for some reason, the recipient can signmessage their PGP public key using the signmessage functionality.

Secure general encryption is a complex subject area, and any "bitcoin encryption" would almost certainly be half baked and insecure in some applications compared to a real encryption tool.  Because of this there is no support in Bitcoind for message encryption and I don't expect any to be planned.