Modify $READLINE_LINE and $READLINE_POINT values inside bash script

I already asked this question on stackoveflow, but received no answer and very few views. I thought I would post here as there should be more bash users and someone might have already stumbled upon this problem. According to SO Meta, it should be ok to do so as long as I link to the cross-website post. Tell me if I’m wrong though, and I’ll just delete this question.