I had a similar situation where I have a customer who has several hundred pages that need to be redirected from non-SEF URLs to a new site with SEF URLs. I'm pasting some code that helped us by automatically escaping the '?' when it is saved to the database. It doesn't keep adding so if you have to update the link, you don't have to delete it each time. Hope this code helps.
In the /administrator/components/com_redj/models/itemredj.php file at the top of the store() function, add:
if(strpos($data['fromurl'], '?') && !strpos($data['fromurl'], '\?')) {
$data['fromurl'] = str_replace('?', '\?', $data['fromurl']);
}
Donald Champion
President of Technical Services, Polished Geek LLC