Joe,
yes, you basically have it correct. Your broker would set aside the $4000 per 100 shares in a money market where you would still earn interest, but the money would be locked up until then. That would be a cash-secured put in a cash account.
I don't use margin much, but you can also do this if you have enough margin and securities to cover the possible cost of buying the shares if put to you.
You asked about the worst thing that could happen. The stock could go bankrupt, in which case you'd end up paying $40/share for a worthless security. So you need to have confidence in the underlying security, and you need to believe that the put strike price is a good place to buy it.
Steve