sell both sides?

#1
Can you write call and put options at the same strike, or would that immediately close both positions?

I am considering getting into options writing, but want clarification on a strategy. Can you write both sides of a strike price? In this case, lets say you have 100 shares of xyz corp, currently trading around $25

could you write put and call options at a strike of $25, and so, if the call is exercised, sell your shares, and if the put is exercised, buy more, but in either case, collect your premium?

More commonly, what I have seen for many securities is that puts and calls that are in the money can sell for prices that make, post assignment, the final price of the shares worthwhile.

for example, xyz at $25, the 25put may push the price per share down to 24, and the 25call to 26. If you were to write each position when the price is in the money for each (as the stock price oscilates) you can widen this spread, but risk failing to setup the position while waiting for the desired price.