As long as you're using drop with any, you should change coin1 and coin2 back into variables, since using them as constants is changing the sequence of random number generation, which is changing the spaces picked to drop pieces on.
To store the position, you should be able to set a constant to the value of $space. To use that constant, you should be able to set the system variable space to its value. You should run your randomization code only if your constant is not already set. If it is set, just use the recorded position. As a proof of concept, I modified Brand X Random Chess to work like this, though I kept in some backwards compatibility with the old way it worked for past games.
As long as you're using drop with any, you should change coin1 and coin2 back into variables, since using them as constants is changing the sequence of random number generation, which is changing the spaces picked to drop pieces on.
To store the position, you should be able to set a constant to the value of $space. To use that constant, you should be able to set the system variable space to its value. You should run your randomization code only if your constant is not already set. If it is set, just use the recorded position. As a proof of concept, I modified Brand X Random Chess to work like this, though I kept in some backwards compatibility with the old way it worked for past games.