You can build you own RIL implementatiion. You can tell Android to load your library by setting the android propety rild.lib. On a rooted phone you can do
getprop | grep ril
to see your current used rild library.
There are opensource ril implementations for sierra gsm dongles / huawei dongles etc. You will get an idea.
But not everything is easily possible. With this mechanism you can only implement the call backs that android is making to you. E.g. it does not allow you to make a data roaming connection. That is still controlled by the android framework.
To change your current rild library to your own you can set
setprop rild.lib \system\modules\yourlibrary.so
see also http://www.kandroid.org/online-pdk/guide/telephony.html