'Remarkable' rehab could save addict from jail