I am considering going back to iPhone 5. I have a chance to buy an i5 with jailbroken 6.1.2 on it. If I get this phone, and restore form iCloud from a previous 6.1.4 i5 that I had, will it mess up the jailbreak on the phone?
The only way to restore from iCloud is to erase all contents and settings which will do horrible things.
If you have an iTunes backup you could just restore from that. That does not affect the software or jailbreak.
Another option would be semi-restore, as that would preserve your jailbreak. However I cannot promise the phone would let you restore from the 6.1.4 backup.