There you go, a neat one-liner:
inoremap <bar> <esc>:execute "normal!".(input('Fill > ') - col('.'))."a "<CR>i
inoremap <bar> <esc>:execute " leave insert mode and execute
"normal!". " a normal command
input('Fill > ') " ask for the column to fill to
- col('.') " subtract to the current column
."a " " append spaces
<CR>i " leave in insert mode
You can use it like this (
 is the cursor position):
this is some text [|]
Fill > 40
this is some text ... 40 spaces ... 
Note: this has to be tested and improved, to handle the edge cases, and probably use this in a function, but you can start with that.
PS: Answer made when OP said he wanted to append space to move the cursor.