You could use something like this:
private void start() {
mBluetoothAdapter.startDiscovery();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (mBluetoothAdapter.isDiscovering())
mBluetoothAdapter.cancelDiscovery();
if (repeat) start();
} }, 5000);
}
Make a variable repeat that is set to false by the stop button. The start button sets repeat to true and calls start().
As far as I know the bluetooth discovery runs indefinitely so you don't need to stop and restart it.