Not sure if this is still of use to anyone, but I discovered how to fix this problem with help from the information at
MySQL Lists: mysql: Re: Deleting Foreign Key. It's a bug in the upgrade script, the field that's being dropped is just a KEY, not a FOREIGN KEY. For the lines that are causing problems, replace "DROP FOREIGN KEY" with "DROP KEY" and it should work.
I've added a comment about it to the bug report at
#1486794 (Unable to add contact groups when using upgraded DB) ? Roundcube Webmail, which looks related. I'm not sure if the problem is caused by not changing the table engines to InnoDB prior to upgrading to Roundcube 0.3 or whether it is a genuine bug in the MySQL upgrade script.