If you keep tapping F8 before Windows loads, one of the options lets you step through the config.sys & autoexec.bat. It's probably something in the config.sys; that's where all the DOS drivers reside. Flashing cursor & locked keyboard indicates a problem with one of them.
Tapping F8 as windows before windows loads means your typing f8 at the prompt. typing it while windows loads does nothing.
F8 while <DOS> loads (DOS 5 and higher) prompts for each line in Config.sys. Then it asks if you would like to step through autoexec.bat as well- if you say y, it does so. if you say n, it simply runs all the commands in autoexec.bat.
F5 skips both altogether.
however, skipping config.sys will mean that himem.sys will not be loaded, so windows 3.1 won't start in that instance either. however, if the starting of windows 3.1 is normally done "automatically" (with win in autoexec.bat) then you can use f5 to skip that and be able to edit it out of autoexec.bat. at that point, you can reboot and see if everything works <up> to loading windows. (for example, watch for error messages from the various drivers that load).
In fact- post your config.sys, autoexec.bat, and C:\windows\system.ini files here.