I've had the new improved lemon-fresh AI launch some mines from planets during combat. They just sit there, waiting for somebody dumb enough to run into them . . .
The way to use them is have them in place before combat. Use a mine-layer to put them in the sector you want to mine (like a warp point!) and wait for the enemy to arrive.
I'm not actually sure what happens if the enemy has a surviving ship and there are mines left over. I think the mines just continue to "attack" automatically until either they are all destroyed or the enemy is wiped out.
Warp points really do work best for mines. The enemy can't see what's on the other side before they warp so they'll plow right into 'em every time.