Thanks for writing your query.
You seems to be correct in your thinking that your pain is due to muscle spasm as a result of sleeping on your forearm.
You should not worry much. It will heal by itself in some hours.
Apply some pain relieving gel three to four tomes a day for relief of your symptoms.
You can take Ibuprofen
after meals if the pain is severe.
Give rest to your arm till the pain subsides.
I hope this is helpful to you.